Re: C11 / VS 2019
Peter Eisentraut <peter@eisentraut.org>
From: Peter Eisentraut <peter@eisentraut.org>
To: Michael Paquier <michael@paquier.xyz>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2025-06-04T06:15:12Z
Lists: pgsql-hackers
Attachments
- 0001-Enable-MSVC-conforming-preprocessor.patch (text/plain) patch 0001
On 03.06.25 06:51, Michael Paquier wrote: > Dropping VS 2015 and going up to VS 2019 brings other benefits, > __VA_ARGS__ coming in mind. Yes, this was going to be my next step. As we're already talking about it, here is my proposed patch. For an explanation, the background is that MSVC has a "traditional" preprocessor and a new "conforming" one. The latter is available starting in VS 2019, but it's not the default. We have some code, especially around __VA_ARGS__ that specifically caters to this traditional preprocessor. Turning on C11 mode in MSVC (/std:c11) automatically turns on the conforming preprocessor, which would currently break compilation on MSVC because the code expects it to be in traditional mode. So my first patch is that we fix that bit and turn on just the conforming preprocessor (/Zc:preprocessor), without turning on C11 yet. That way, we get that part out of the way, and we update the documentation about requiring VS 2019. (And we'd flush out anyone who might still be running pre-VS-2019 build jobs somewhere.) Later, when we turn on C11, we can remove the explicit /Zc:preprocessor option again. (An alternative approach would be to turn on C11 and add another option to explicitly turn the traditional preprocessor back on, but that seems pointless, and the documentation also suggests that that combination is not well supported.) So the attached patch is my proposal to commit early in PG19.
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Raise C requirement to C11
- f5e0186f865c 19 (unreleased) landed
-
meson: Move C99 test earlier
- 4a4038068bb2 19 (unreleased) landed
-
Enable MSVC conforming preprocessor
- 8fd9bb1d9654 19 (unreleased) landed
-
Make parseNodeString() C idiom compatible with Visual Studio 2015.
- f9f31aa91f82 16.0 cited