From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@postgresql.org
Subject: Re: macos ventura SDK spews warnings
Date: Sun, 16 Oct 2022 12:40:11 -0400
Message-ID: <1803927.1665938411@sss.pgh.pa.us> (raw)
In-Reply-To: <20221016053443.f6oyf7znbrfm4m4w@awork3.anarazel.de>
References: <20221015211955.q4cwbsfkyk3c4ty3@awork3.anarazel.de>
<1597270.1665871013@sss.pgh.pa.us>
<1605190.1665874036@sss.pgh.pa.us>
<20221015235040.mvags2i5oosks4ui@awork3.anarazel.de>
<1613234.1665878923@sss.pgh.pa.us>
<1618364.1665882000@sss.pgh.pa.us>
<20221016053443.f6oyf7znbrfm4m4w@awork3.anarazel.de>
Andres Freund <andres@anarazel.de> writes:
> On 2022-10-15 21:00:00 -0400, Tom Lane wrote:
>> After further thought, I think the best compromise is just that:
>>
>> (1) apply s/sprintf/snprintf/ patch in branches back to v12, where
>> we began to require C99.
>>
>> (2) in v11 and back to 9.2, enable -Wno-deprecated if available.
> Makes sense to me.
I remembered another reason why v12 should be a cutoff: it's where
we started to use snprintf.c everywhere. In prior branches, there'd
be a lot of complaints about sprintf elsewhere in the tree.
So I pushed (1), but on the way to testing (2), I discovered a totally
independent problem with the 13.0 SDK in older branches:
In file included from ../../../src/include/postgres.h:46:
In file included from ../../../src/include/c.h:1387:
In file included from ../../../src/include/port.h:17:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.0.sdk/usr/include/netdb.h:91:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.0.sdk/usr/include/netinet/in.h:81:
/Library/Developer/CommandLineTools/SDKs/MacOSX13.0.sdk/usr/include/sys/socket.h:471:1: error: expected ';' after top level declarator
__CCT_DECLARE_CONSTRAINED_PTR_TYPES(struct sockaddr_storage, sockaddr_storage);
^
This is apparently some sort of inclusion-order problem, which is probably
a bug in the SDK --- netdb.h and netinet/in.h are the same as they were in
SDK 12.3, but sys/socket.h has a few additions including this
__CCT_DECLARE_CONSTRAINED_PTR_TYPES macro, and evidently that's missing
something it needs. I haven't traced down the cause of the problem yet.
It fails to manifest in v15 and HEAD, which I bisected to
98e93a1fc93e9b54eb477d870ec744e9e1669f34 is the first new commit
commit 98e93a1fc93e9b54eb477d870ec744e9e1669f34
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: Tue Jan 11 13:46:12 2022 -0500
Clean up messy API for src/port/thread.c.
The point of this patch is to reduce inclusion spam by not needing
to #include <netdb.h> or <pwd.h> in port.h (which is read by every
compile in our tree). To do that, we must remove port.h's
declarations of pqGetpwuid and pqGethostbyname.
I doubt we want to back-patch that, so what we'll probably end up with
is adding some #includes to port.h in the back branches. Bleah.
Or we could file a bug with Apple and hope they fix it quickly.
(They might, actually, because this SDK is supposedly beta.)
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, andres@anarazel.de
Subject: Re: macos ventura SDK spews warnings
In-Reply-To: <1803927.1665938411@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox