Re: MSVC compilers complain about snprintf

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2018-10-17T22:11:55Z
Lists: pgsql-hackers
Andrew Dunstan <andrew.dunstan@2ndquadrant.com> writes:
> 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

Yeah, see commit 4868e4468590bc32f9c3afed4ec795d6a7732c9d.

The law of conservation of warning messages seems to be at work :-(

			regards, tom lane


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.