[HACKERS] GCC 7 warnings - Mailing list pgsql-hackers

From Peter Eisentraut
Subject [HACKERS] GCC 7 warnings
Date
Msg-id dd7e5c64-86ec-9e96-e682-a57d1cb9bcc2@2ndquadrant.com
Whole thread Raw
Responses Re: [HACKERS] GCC 7 warnings  (Aleksander Alekseev <a.alekseev@postgrespro.ru>)
Re: [HACKERS] GCC 7 warnings  (Andres Freund <andres@anarazel.de>)
Re: [HACKERS] GCC 7 warnings  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: [HACKERS] GCC 7 warnings  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-hackers
The release of GCC 7 is approaching [0], and the number of warnings in
PostgreSQL has gone up since we last looked [1].  Output attached.  (My
version is 7.0.1 20170408.)

Most of the issues have to do with concatenating two or more strings of
potential size MAXPGPATH into another buffer of size MAXPGPATH, which
could lead to truncation.

Possible fixes:

a) Ignore, hoping GCC will change before final release. (unlikely at
this point)

b) Add compiler option to disable this particular warning, worry about
it later.  (Might be an option for backpatching.)

c) Expand the target buffer sizes until the warning goes away.  (Sample
patch attached.)

d) Replace most of the problematic code with psprintf() and dynamically
sized buffers.

Comments?


[0]: https://gcc.gnu.org/ml/gcc/2017-03/msg00066.html
[1]:
https://www.postgresql.org/message-id/CAFj8pRA=xV0_-aDF5UtGVY8HGvg+ovA_js_P8z4jLHxvX0Wa=A@mail.gmail.com

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachment

pgsql-hackers by date:

Previous
From: Jeevan Ladhe
Date:
Subject: Re: [HACKERS] Adding support for Default partition in partitioning
Next
From: Peter Eisentraut
Date:
Subject: [HACKERS] contrib/bloom wal-check not run by default