pgsql: Avoid unportable usage of sscanf(UINT64_FORMAT). - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Avoid unportable usage of sscanf(UINT64_FORMAT).
Date
Msg-id E1Wp73Y-0005Ds-0B@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Avoid unportable usage of sscanf(UINT64_FORMAT).

On Mingw, it seems that scanf() doesn't necessarily accept the same format
codes that printf() does, and in particular it may fail to recognize %llu
even though printf() does.  Since configure only probes printf() behavior
while setting up the INT64_FORMAT macros, this means it's unsafe to use
those macros with scanf().  We had only one instance of such a coding
pattern, in contrib/pg_stat_statements, so change that code to avoid
the problem.

Per buildfarm warnings.  Back-patch to 9.0 where the troublesome code
was introduced.

Michael Paquier

Branch
------
REL9_2_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/9a21ac082f5bfedac5d1a76d9c04e7c786cc242b

Modified Files
--------------
contrib/pg_stat_statements/pg_stat_statements.c |   12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Avoid unportable usage of sscanf(UINT64_FORMAT).
Next
From: Tom Lane
Date:
Subject: pgsql: Avoid unportable usage of sscanf(UINT64_FORMAT).