Re: MSVC: Improve warning options set

Andres Freund <andres@anarazel.de>

From: Andres Freund <andres@anarazel.de>
To: Peter Eisentraut <peter@eisentraut.org>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2025-11-03T19:15:59Z
Lists: pgsql-hackers
Hi,

On 2025-10-29 08:51:00 +0100, Peter Eisentraut wrote:
> meson.build has a list of warnings to disable on MSVC:
> 
>   cflags_warn += [
>     '/wd4018', # signed/unsigned mismatch
>     '/wd4244', # conversion from 'type1' to 'type2', possible loss of data
>     '/wd4273', # inconsistent DLL linkage
>     '/wd4101', # unreferenced local variable
>     '/wd4102', # unreferenced label
>     '/wd4090', # different 'modifier' qualifiers
>     '/wd4267', # conversion from 'size_t' to 'type', possible loss of data
>   ]
> 
> First, these appear to be in some random order, so I wanted to sort them.

FWIW, I just transported them 1:1 from src/tools/msvc, at the time it seemed
more important to keep things consistent than to clean up.

Greetings,

Andres Freund



Commits

  1. Fix "inconsistent DLL linkage" warning on Windows MSVC

  2. MSVC: Improve warning options set

  3. Enable MSVC conforming preprocessor

  4. Fix warnings about declaration of environ on MinGW.

  5. Require ucrt if using MinGW.