public inbox for [email protected]
help / color / mirror / Atom feedFrom: Tristan Partin <[email protected]>
To: Michael Paquier <[email protected]>
Cc: Sutou Kouhei <[email protected]>
Cc: [email protected]
Subject: Re: meson: Specify -Wformat as a common warning flag for extensions
Date: Fri, 08 Mar 2024 10:05:27 -0600
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
<[email protected]>
On Fri Mar 8, 2024 at 12:32 AM CST, Michael Paquier wrote:
> On Thu, Mar 07, 2024 at 11:39:39PM -0600, Tristan Partin wrote:
> > It sounds like a legitimate issue. I have confirmed the issue exists with a
> > pg_config compiled with Meson. I can also confirm that this issue exists in
> > the autotools build.
>
> First time I'm hearing about that, but I'll admit that I am cheating
> because -Wformat is forced in my local builds for some time now. I'm
> failing to see the issue with meson and ./configure even if I remove
> the switch, though, using a recent version of gcc at 13.2.0, but
> perhaps Debian does something underground. Are there version and/or
> environment requirements to be aware of?
>
> Forcing -Wformat implies more stuff that can be disabled with
> -Wno-format-contains-nul, -Wno-format-extra-args, and
> -Wno-format-zero-length, but the thing is that we're usually very
> conservative with such additions in the scripts. See also
> 8b6f5f25102f, done, I guess, as an answer to this thread:
> https://www.postgresql.org/message-id/4D431505.9010002%40dunslane.net
>
> A quick look at the past history of pgsql-hackers does not mention
> that as a problem, either, but I may have missed something.
Ok, I figured this out. -Wall implies -Wformat=1. We set warning_level
to 1 in the Meson project() call, which implies -Wall, and set -Wall in
CFLAGS for autoconf. That's the reason we don't get issues building
Postgres. A user making use of the pg_config --cflags option, as Sutou
is, *will* run into the aforementioned issues, since we don't propogate
-Wall into pg_config.
$ gcc $(pg_config --cflags) -E - < /dev/null > /dev/null
cc1: warning: ‘-Wformat-security’ ignored without ‘-Wformat’ [-Wformat-security]
$ gcc -Wall $(pg_config --cflags) -E - < /dev/null > /dev/null
(nothing printed)
--
Tristan Partin
Neon (https://neon.tech)
view thread (4+ messages)
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: meson: Specify -Wformat as a common warning flag for extensions
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox