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

From: Sutou Kouhei <kou(at)clear-code(dot)com>
To: tristan(at)neon(dot)tech
Cc: michael(at)paquier(dot)xyz, pgsql-hackers(at)postgresql(dot)org
Subject: Re: meson: Specify -Wformat as a common warning flag for extensions
Date: 2024-03-13 07:12:00
Message-ID: 20240313.161200.2215289102254898854.kou@clear-code.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

In <CZSDSNYEUHUL(dot)399XLPGCJSJ5H(at)neon(dot)tech>
"Re: meson: Specify -Wformat as a common warning flag for extensions" on Wed, 13 Mar 2024 00:43:11 -0500,
"Tristan Partin" <tristan(at)neon(dot)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

Attachment Content-Type Size
v3-0001-Add-Wformat-to-common-warning-flags.patch text/x-patch 6.4 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message shveta malik 2024-03-13 07:15:06 Re: Introduce XID age and inactive timeout based replication slot invalidation
Previous Message Peter Eisentraut 2024-03-13 06:45:26 Re: Disable LLVM bitcode generation with pgxs.mk framework.