Re: meson: Specify -Wformat as a common warning flag for extensions

Sutou Kouhei <kou@clear-code.com>

From: Sutou Kouhei <kou@clear-code.com>
To: tristan@neon.tech
Cc: michael@paquier.xyz, pgsql-hackers@postgresql.org
Date: 2024-03-13T07:12:00Z
Lists: pgsql-hackers

Attachments

Hi,

In <CZSDSNYEUHUL.399XLPGCJSJ5H@neon.tech>
  "Re: meson: Specify -Wformat as a common warning flag for extensions" on Wed, 13 Mar 2024 00:43:11 -0500,
  "Tristan Partin" <tristan@neon.tech> wrote:

> Perhaps adding some more clarification in the comments that I wrote.
> 
> -  # -Wformat-security requires -Wformat, so check for it
> + # -Wformat-secuirty requires -Wformat. We compile with -Wall in + #
> Postgres, which includes -Wformat=1. -Wformat is shorthand for + #
> -Wformat=1. The set of flags which includes -Wformat-security is + #
> persisted into pg_config --cflags, which is commonly used by + #
> PGXS-based extensions. The lack of -Wformat in the persisted flags
> + # will produce a warning on many GCC versions, so even though adding
> + # -Wformat here is a no-op for Postgres, it silences other use
> cases.
> 
> That might be too long-winded though :).

Thanks for the wording! I used it for the v3 patch.


Thanks,
-- 
kou

Commits

  1. meson: Restore implicit warning/debug/optimize flags for extensions