mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-22 10:12:10 +01:00
build: Enforce use of C99 flexible arrays and enable bounds checking
This nudges us towards requiring more compile time array bounds checking where it’s supported by the compiler. See https://people.kernel.org/kees/bounded-flexible-arrays-in-c Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This commit is contained in:
parent
1f9bcba295
commit
71aeb3de5a
@ -570,6 +570,10 @@ if cc.get_id() == 'gcc' or cc.get_id() == 'clang'
|
||||
]
|
||||
|
||||
warning_c_args = warning_common_args + [
|
||||
# Ensure that any use of flexible arrays is C99-compatible
|
||||
# See https://people.kernel.org/kees/bounded-flexible-arrays-in-c
|
||||
'-fstrict-flex-arrays',
|
||||
'-Werror=array-bounds',
|
||||
'-Wstrict-prototypes',
|
||||
# Due to pervasive use of things like GPOINTER_TO_UINT(), we do not support
|
||||
# building with -Wbad-function-cast.
|
||||
|
Loading…
x
Reference in New Issue
Block a user