PG 17.2 compilation fails with -std=c11 on mac
Lakshmi Narayana Velayudam <dev.narayana.v@gmail.com>
From: Lakshmi Narayana Velayudam <dev.narayana.v@gmail.com>
To: pgsql-hackers@postgresql.org
Date: 2025-05-16T13:44:07Z
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
Commits
-
Make our usage of memset_s() conform strictly to the C11 standard.
- a1e0e7076585 14.19 landed
- 9bc2d37ccaab 13.22 landed
- 5355a2400e84 17.6 landed
- 253cf661c226 16.10 landed
- 12eee85e511f 18.0 landed
- 00652b3c9fb7 15.14 landed