diff --git a/configure.ac b/configure.ac index 8c6498b763b4447b72cfe6acdde5c1d71805b1f3..bfebe9cdb2f46c922edd3df13fffbc928a959d38 100644 --- a/configure.ac +++ b/configure.ac @@ -1192,9 +1192,9 @@ AC_ARG_ENABLE([extra_checks], [Turn some warnings into compilation error (default disabled)]),, [enable_extra_checks="no"]) AS_IF([test "${enable_extra_checks}" = "yes"], [ - AX_APPEND_COMPILE_FLAGS([-Werror=missing-field-initializers -Werror=format -Werror=incompatible-pointer-types -Werror=restrict -Werror=int-conversion -Werror=implicit-int -Werror=return-mismatch -Werror=declaration-missing-parameter-type], [CFLAGS]) + AX_APPEND_COMPILE_FLAGS([-Werror=missing-field-initializers -Werror=format -Werror=incompatible-pointer-types -Werror=restrict -Werror=int-conversion -Werror=implicit-int -Werror=return-mismatch -Werror=declaration-missing-parameter-type -Werror=excess-initializers], [CFLAGS]) AC_LANG_PUSH(C++) - AX_APPEND_COMPILE_FLAGS([-Werror=missing-field-initializers -Werror=format], [CXXFLAGS]) + AX_APPEND_COMPILE_FLAGS([-Werror=missing-field-initializers -Werror=format -Werror=excess-initializers], [CXXFLAGS]) AC_LANG_POP(C++) ]) diff --git a/meson.build b/meson.build index 70f44cb30d307a3b2b36e1b763f17ab50564683c..01fabffd9c40717557e44f95a5aebba28f5dcd12 100644 --- a/meson.build +++ b/meson.build @@ -509,11 +509,13 @@ if get_option('extra_checks') '-Werror=restrict', '-Werror=int-conversion', '-Werror=implicit-int', - '-Werror=declaration-missing-parameter-type' + '-Werror=declaration-missing-parameter-type', + '-Werror=excess-initializers', ]), language: ['c']) add_project_arguments(cpp.get_supported_arguments([ '-Werror=missing-field-initializers', '-Werror=format', + '-Werror=excess-initializers', ]), language: ['cpp']) endif