fixing more format truncation issues - Mailing list pgsql-hackers

From Peter Eisentraut
Subject fixing more format truncation issues
Date
Msg-id 304a21ab-a9d6-264a-f688-912869c0d7c6@2ndquadrant.com
Whole thread Raw
Responses Re: fixing more format truncation issues  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
In 6275f5d28a1577563f53f2171689d4f890a46881, we fixed warnings from the
options -Wformat-overflow and -Wformat-truncation, which are part of
-Wall in gcc 7.

Here, I propose to dial this up a bit by adding -Wformat-overflow=2
-Wformat-truncation=2, which use some more worst-case approaches for
estimating the buffer sizes.

AFAICT, the issues addressed here either can't really happen without
trying very hard, or would cause harmless output truncation.  Still, it
seems good to clean this up properly and not rely on made-up buffer size
guesses that turn out to be wrong, even if we don't want to adopt the
warning options by default.

One issue that is of external interest is that I increase BGW_MAXLEN
from 64 to 96.  Apparently, the old value would cause the bgw_name of
logical replication workers to be truncated in some circumstances.  I
have also seen truncated background worker names with third-party
packages, so giving some more room here would be useful.

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

Attachment

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: chained transactions
Next
From: Thomas Munro
Date:
Subject: Re: [HACKERS] SERIALIZABLE with parallel query