PG 17.2 compilation fails with -std=c11 on mac

From: Lakshmi Narayana Velayudam <dev(dot)narayana(dot)v(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: PG 17.2 compilation fails with -std=c11 on mac
Date: 2025-05-16 13:44:07
Message-ID: CAA4pTnLcKGG78xeOjiBr5yS7ZeE-Rh=FaFQQGOO=nPzA1L8yEA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

When I trying to compiling postgres 17.2 with -std=c11 I am getting the
below error on mac

explicit_bzero.c:22:9: error: call to undeclared function 'memset_s'; ISO
C99 and later do not support implicit function declarations
[-Wimplicit-function-declaration]

22 | (void) memset_s(buf, len, 0, len);

*PG compilation commands:*
./configure --prefix=$PWD/pgsql --enable-cassert --enable-debug
CFLAGS="-ggdb -fno-omit-frame-pointer -O0 -std=c11" --without-icu
make -s clean
make -s -j
make install -j

*Mac OS:* 15.1.1

*Temporary fix: *without *-std=c11 *or replacing *memset_s* with *memset*
in *explicit_bzero* is working

*The same issue was reported in 16.2:*
https://www.postgresql.org/message-id/flat/CAJ4xhPmqZuYb2ydsKqkfm7wSnmVMD2cqQ%2By51qhTWkb-SfVG-w%40mail.gmail.com

Thanks & Regards
Narayana

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-05-16 14:00:03 Re: Align wording on copyright organization
Previous Message Dave Page 2025-05-16 13:31:41 Re: Align wording on copyright organization