build: Enable -Wundef warning by default

We prefer `#ifdef` to `#if` in code, so let’s use the `-Wundef` warning
to enforce that. In CI, `-Werror` is enabled, so this should be
enforcement enough.

Suggested by Thomas Haller.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This commit is contained in:
Philip Withnall 2025-04-10 11:48:09 +01:00
parent 76ed4680bb
commit 32f68bef2e
No known key found for this signature in database
GPG Key ID: C5C42CFB268637CA

View File

@ -579,6 +579,8 @@ if cc.get_id() == 'gcc' or cc.get_id() == 'clang'
'-Wmissing-field-initializers',
'-Wnonnull',
'-Wnull-dereference',
# We prefer #ifdef to #if
'-Wundef',
'-Wunused',
# Due to maintained deprecated code, we do not want to see unused parameters
'-Wno-unused-parameter',