Re: C11 / VS 2019 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: C11 / VS 2019
Date
Msg-id 1345212.1752091825@sss.pgh.pa.us
Whole thread Raw
In response to Re: C11 / VS 2019  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: C11 / VS 2019
List pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> writes:
> On 2025-07-08 Tu 4:10 PM, Andrew Dunstan wrote:
>> On 2025-07-08 Tu 3:45 PM, Tom Lane wrote:
>>> In the no-good-deed-goes-unpunished department ... drongo is now spewing
>>> a boatload of these warnings:
>>> 
>>> C:\\Program Files (x86)\\Windows 
>>> Kits\\10\\include\\10.0.18362.0\\um\\winbase.h(9305): warning C5105: 
>>> macro expansion producing 'defined' has undefined behavior

> The relevant portion of the winbase.h file appears to be:

>     #define
>     MICROSOFT_WINDOWS_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS
>     (_WIN32_WINNT >= 0x0502 || !defined(_WINBASE_))

Hmm ... I don't pretend to be enough of a C language lawyer to know
whether this should have undefined behavior per spec, but it surely
does meet the conditions stated in the warning message.

I wonder if we should do what it says here:

>     /*
>     To turn off/hide the contents of this file:
>       #define
>     MICROSOFT_WINDOWS_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS 0
>     */

> I don't think we have any other VS 2019 machines in the buildfarm. I can 
> try installing VS 2022, which hamerkop seems to be running without 
> producing the error.

That would amount to desupporting VS 2019, which I'm not sure we want
to do yet.  I don't have a huge problem with ignoring this warning.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: C11 / VS 2019
Next
From: Andres Freund
Date:
Subject: Re: C11 / VS 2019