Re: MSVC compilers complain about snprintf

Andres Freund <andres@anarazel.de>

From: Andres Freund <andres@anarazel.de>
To: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2018-10-17T21:31:31Z
Lists: pgsql-hackers
Hi,

On 2018-10-17 17:27:14 -0400, Andrew Dunstan wrote:
> 
> The MSVC compilers are whingeing about recent changes in snprintf.c:
> 
> 
>    src\port\snprintf.c(1051): warning C4146: unary minus operator
>    applied to unsigned type, result still unsigned
> 
> 
> The line in question reads:
> 
>    uvalue = -(unsigned long long) value;

Yea, that's intended. Is there a way to silence that one, but just keep
the code largely similar?

Greetings,

Andres Freund


Commits

  1. Disable MSVC warning caused by recent snprintf.c changes

  2. Ensure that snprintf.c's fmtint() doesn't overflow when printing INT64_MIN.