Re: PG 17.2 compilation fails with -std=c11 on mac

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Lakshmi Narayana Velayudam <dev.narayana.v@gmail.com>
Cc: pgsql-hackers@postgresql.org
Date: 2025-05-16T20:58:05Z
Lists: pgsql-hackers

Attachments

I wrote:
> We lack that #define, which results in <string.h> not supplying
> the declaration.  AFAICT the requirement for this is in the C11
> standard, this is not just Apple doing something weird.
> Aside from this compilation error, we're probably failing to use
> memset_s on some platforms where it's available, for lack of
> the #define in our configure/meson probes.  I know how to fix
> that in configure, but I'm less clear on how nonstandard probes
> work in meson --- any help there?

Here's a lightly-tested fix for that (against HEAD, but it likely
works on v17 too).

			regards, tom lane

Commits

  1. Make our usage of memset_s() conform strictly to the C11 standard.