Do kep them for debug and debugoptimized builds though.
Keeping -Werror flags in release builds causes issues with forward
compatibility, when new compiler releases or different toolchains
suddenly cause those warnings to be emitted during compilation.
While we certainly want those issues to be investigated and fixed, they
should not prevent anyone from building GTK until they are.
Resolves #4388
'-Wundef',
'-Wuninitialized',
'-Wunused',
+ ]
+
+ extra_warnings = [
'-Werror=address',
'-Werror=array-bounds',
'-Werror=empty-body',
'-Werror=write-strings',
]
+ if get_option('buildtype').startswith('debug')
+ foreach warning: extra_warnings
+ test_cflags += '-Werror=@0@'.format(warning)
+ endforeach
+ else
+ foreach warning: extra_warnings
+ test_cflags += '-W@0@'.format(warning)
+ endforeach
+ endif
+
if cc.get_id() == 'gcc'
test_cflags += ['-Wcast-align'] # This warns too much on clang
endif