Re: MSVC: Improve warning options set

Peter Eisentraut <peter@eisentraut.org>

From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-hackers@lists.postgresql.org
Cc: Bryan Green <dbryan.green@gmail.com>, Andres Freund <andres@anarazel.de>
Date: 2025-11-08T16:33:29Z
Lists: pgsql-hackers
On 03.11.25 20:26, Andres Freund wrote:
> On 2025-11-03 19:56:16 +0100, Peter Eisentraut wrote:
>> I don't know if we still support MSVCRT if using MSVC, or how long we still
>> need to support it.  (Or, for example, how to tell which variant CI or the
>> buildfarm uses.)
> 
> To my knowledge anything close to a recent version visual studio / msvc don't
> use msvcrt anymore. Starting at least with VS 2015. I don't think our code
> would really work when building against msvcrt anyway (mingw worked for
> longer, because they added additional functionality in wrapper libraries,
> IIRC).

I have committed both of the patches as proposed, and both relevant 
buildfarm members have had no complaints.




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.