Re: C11 / VS 2019

Andrew Dunstan <andrew@dunslane.net>

From: Andrew Dunstan <andrew@dunslane.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Peter Eisentraut <peter@eisentraut.org>, Nazir Bilal Yavuz <byavuz81@gmail.com>, Michael Paquier <michael@paquier.xyz>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2025-07-09T19:56:12Z
Lists: pgsql-hackers
On 2025-07-08 Tu 4:10 PM, Andrew Dunstan wrote:
>
> On 2025-07-08 Tu 3:45 PM, Tom Lane wrote:
>> Andrew Dunstan <andrew@dunslane.net> writes:
>>> It's done and running. Testing before I re-enabled the animal it shows
>>> it was happy.
>> 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
>>
>> Looks like this comes out once per .c file -- probably it's
>> in an inclusion from <windows.h>.  Dunno if there's anything
>> we can do but ignore it.  I wonder though why we have not seen
>> this on other buildfarm animals.
>>
>>
>
>
> *sigh*
>
>
> will investigate.
>
>
>

No grand insights yet. I note that this is not occurring on the back 
branches.

Here's the MS page describing the error: 
https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/c5105?view=msvc-170

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

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

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

    #if
    MICROSOFT_WINDOWS_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS
    /* { */


The last line is 9305.

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.


cheers


andrew


--
Andrew Dunstan
EDB:https://www.enterprisedb.com

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Raise C requirement to C11

  2. meson: Move C99 test earlier

  3. Enable MSVC conforming preprocessor

  4. Make parseNodeString() C idiom compatible with Visual Studio 2015.