Re: New string-truncation warnings from GCC 15 - Mailing list pgsql-hackers

From Andres Freund
Subject Re: New string-truncation warnings from GCC 15
Date
Msg-id ns5kbonarnq4ocp7y4v5q27476pfufjrc6ktuchcjyezcfmdke@tnuyobpgjbsy
Whole thread Raw
In response to Re: New string-truncation warnings from GCC 15  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: New string-truncation warnings from GCC 15
List pgsql-hackers
On 2025-09-17 17:00:42 -0400, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
> > On 2025-09-17 16:38:56 -0400, Tom Lane wrote:
> >> Oh!  Hmm... I am not sure that we want to commit to being -Wextra
> >> clean across-the-board.
> 
> > We've been -Wextra clean for years, with a few temporary exceptions. IME a lot
> > of warnings added to -Wextra in one year, get promoted to -Wall a few releases
> > later. I found plenty mistakes with -Wextra stuff, so I'd be sad if we decided
> > we're not trying to fix them...
> 
> Well, we should either commit to it (and put -Wextra into our
> standard switches) or not.

I'd be mildly worried about -Wextra in older compilers (and clang, but just
because I don't regularly track -Wextra with clang). But I'd be up for trying
it out.

A slightly more targeted approach would be to add -Wstringop-truncation to our
explicitly enabled warnings...

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: REPACK and naming
Next
From: Tom Lane
Date:
Subject: Re: New string-truncation warnings from GCC 15