Re: meson: Specify -Wformat as a common warning flag for extensions - Mailing list pgsql-hackers

From Sutou Kouhei
Subject Re: meson: Specify -Wformat as a common warning flag for extensions
Date
Msg-id 20240313.085638.207599003452490069.kou@clear-code.com
Whole thread Raw
In response to Re: meson: Specify -Wformat as a common warning flag for extensions  ("Tristan Partin" <tristan@neon.tech>)
Responses Re: meson: Specify -Wformat as a common warning flag for extensions
List pgsql-hackers
Hi,

In <CZOHWDYQJQCQ.23A5RRV1E05N2@neon.tech>
  "Re: meson: Specify -Wformat as a common warning flag for extensions" on Fri, 08 Mar 2024 10:05:27 -0600,
  "Tristan Partin" <tristan@neon.tech> wrote:

> 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)

Thanks for explaining this. You're right. This is the reason
why we don't need this for PostgreSQL itself but we need
this for PostgreSQL extensions. Sorry. I should have
explained this in the first e-mail...


What should we do to proceed this patch?


Thanks,
-- 
kou

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Add new error_action COPY ON_ERROR "log"
Next
From: Xing Guo
Date:
Subject: Re: Disable LLVM bitcode generation with pgxs.mk framework.