[HACKERS] new gcc 7.0.1 warnings - Mailing list pgsql-hackers

From Pavel Stehule
Subject [HACKERS] new gcc 7.0.1 warnings
Date
Msg-id CAFj8pRA=xV0_-aDF5UtGVY8HGvg+ovA_js_P8z4jLHxvX0Wa=A@mail.gmail.com
Whole thread Raw
Responses Re: [HACKERS] new gcc 7.0.1 warnings  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: [HACKERS] new gcc 7.0.1 warnings  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-hackers
Hi

I am checking new Fedora 26, where new gcc compiler is used.

float.c: In function ‘float4out’:
float.c:382:41: warning: ‘%.*g’ directive output may be truncated writing between 1 and 310 bytes into a region of size 65 [-Wformat-truncation=]
     snprintf(ascii, MAXFLOATWIDTH + 1, "%.*g", ndig, num);
                                         ^~~~
float.c:382:5: note: ‘snprintf’ output between 2 and 311 bytes into a destination of size 65
     snprintf(ascii, MAXFLOATWIDTH + 1, "%.*g", ndig, num);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
float.c: In function ‘float8out_internal’:
float.c:618:42: warning: ‘%.*g’ directive output may be truncated writing between 1 and 310 bytes into a region of size 129 [-Wformat-truncation=]
     snprintf(ascii, MAXDOUBLEWIDTH + 1, "%.*g", ndig, num);
                                          ^~~~
float.c:618:5: note: ‘snprintf’ output between 2 and 311 bytes into a destination of size 129
     snprintf(ascii, MAXDOUBLEWIDTH + 1, "%.*g", ndig, num);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Regards

Pavel

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: [HACKERS] Parallel Index-only scan
Next
From: Alexander Korotkov
Date:
Subject: [HACKERS] [PATCH] Incremental sort (was: PoC: Partial sort)