build: Enable -Wnull-dereference warning

This enables `NULL` pointer dereference checking in the compiler. This
isn’t as good as static analysis, but it should hopefully catch some
simple errors without too high a false positive rate.

If the false positive rate is too high to be useful, we can always
disable it again.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #1767
This commit is contained in:
Philip Withnall 2024-04-12 16:05:37 +01:00
parent 0f869f3d73
commit b2f27beb34
No known key found for this signature in database
GPG Key ID: DCDF5885B1F3ED73

View File

@ -549,6 +549,7 @@ if cc.get_id() == 'gcc' or cc.get_id() == 'clang'
'-Wmisleading-indentation',
'-Wmissing-field-initializers',
'-Wnonnull',
'-Wnull-dereference',
'-Wunused',
# Due to maintained deprecated code, we do not want to see unused parameters
'-Wno-unused-parameter',