Re: meson: Specify -Wformat as a common warning flag for extensions
От | Peter Eisentraut |
---|---|
Тема | Re: meson: Specify -Wformat as a common warning flag for extensions |
Дата | |
Msg-id | 49e97fd0-c17e-4cbc-aeee-80ac51400736@eisentraut.org обсуждение исходный текст |
Ответ на | Re: meson: Specify -Wformat as a common warning flag for extensions ("Tristan Partin" <tristan@neon.tech>) |
Ответы |
Re: meson: Specify -Wformat as a common warning flag for extensions
|
Список | pgsql-hackers |
On 08.03.24 17:05, Tristan Partin 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. (The actual mechanism for extensions is that they get CFLAGS from Makefile.global, but pg_config has the same underlying issue.) I think the fix then is to put -Wall into CFLAGS in Makefile.global. Looking at a diff of Makefile.global between an autoconf and a meson build, I also see that under meson, CFLAGS doesn't get -O2 -g (or similar, depending on settings). This presumably has the same underlying issue that meson handles those flags internally. For someone who wants to write a fix for this, the relevant variable is var_cflags in our meson scripts. And var_cxxflags as well.
В списке pgsql-hackers по дате отправления: