new gcc 7.0.1 warnings

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: new gcc 7.0.1 warnings
Date: 2017-02-18 07:08:02
Message-ID: CAFj8pRA=xV0_-aDF5UtGVY8HGvg+ovA_js_P8z4jLHxvX0Wa=A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2017-02-18 10:31:29 [PATCH] Incremental sort (was: PoC: Partial sort)
Previous Message Amit Kapila 2017-02-18 06:32:22 Re: Parallel Index-only scan