mirror of
https://github.com/mii443/qemu.git
synced 2025-08-22 15:15:46 +00:00
meson: sort C warning flags alphabetically
When scanning the list of warning flags to see if one is present, it is helpful if they are in alphabetical order. It is further helpful to separate out the 'no-' prefixed warnings. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
40
meson.build
40
meson.build
@ -571,36 +571,38 @@ qemu_common_flags += cc.get_supported_arguments(hardening_flags)
|
|||||||
add_global_arguments(qemu_common_flags, native: false, language: all_languages)
|
add_global_arguments(qemu_common_flags, native: false, language: all_languages)
|
||||||
add_global_link_arguments(qemu_ldflags, native: false, language: all_languages)
|
add_global_link_arguments(qemu_ldflags, native: false, language: all_languages)
|
||||||
|
|
||||||
# Collect warnings that we want to enable
|
# Collect warning flags we want to set, sorted alphabetically
|
||||||
|
|
||||||
warn_flags = [
|
warn_flags = [
|
||||||
'-Wundef',
|
# First enable interesting warnings
|
||||||
'-Wwrite-strings',
|
|
||||||
'-Wmissing-prototypes',
|
|
||||||
'-Wstrict-prototypes',
|
|
||||||
'-Wredundant-decls',
|
|
||||||
'-Wold-style-declaration',
|
|
||||||
'-Wold-style-definition',
|
|
||||||
'-Wtype-limits',
|
|
||||||
'-Wformat-security',
|
|
||||||
'-Wformat-y2k',
|
|
||||||
'-Winit-self',
|
|
||||||
'-Wignored-qualifiers',
|
|
||||||
'-Wempty-body',
|
'-Wempty-body',
|
||||||
'-Wnested-externs',
|
|
||||||
'-Wendif-labels',
|
'-Wendif-labels',
|
||||||
'-Wexpansion-to-defined',
|
'-Wexpansion-to-defined',
|
||||||
|
'-Wformat-security',
|
||||||
|
'-Wformat-y2k',
|
||||||
|
'-Wignored-qualifiers',
|
||||||
'-Wimplicit-fallthrough=2',
|
'-Wimplicit-fallthrough=2',
|
||||||
|
'-Winit-self',
|
||||||
'-Wmissing-format-attribute',
|
'-Wmissing-format-attribute',
|
||||||
|
'-Wmissing-prototypes',
|
||||||
|
'-Wnested-externs',
|
||||||
|
'-Wold-style-declaration',
|
||||||
|
'-Wold-style-definition',
|
||||||
|
'-Wredundant-decls',
|
||||||
|
'-Wshadow=local',
|
||||||
|
'-Wstrict-prototypes',
|
||||||
|
'-Wtype-limits',
|
||||||
|
'-Wundef',
|
||||||
|
'-Wwrite-strings',
|
||||||
|
|
||||||
|
# Then disable some undesirable warnings
|
||||||
|
'-Wno-gnu-variable-sized-type-not-at-end',
|
||||||
'-Wno-initializer-overrides',
|
'-Wno-initializer-overrides',
|
||||||
'-Wno-missing-include-dirs',
|
'-Wno-missing-include-dirs',
|
||||||
|
'-Wno-psabi',
|
||||||
'-Wno-shift-negative-value',
|
'-Wno-shift-negative-value',
|
||||||
'-Wno-string-plus-int',
|
'-Wno-string-plus-int',
|
||||||
'-Wno-typedef-redefinition',
|
|
||||||
'-Wno-tautological-type-limit-compare',
|
'-Wno-tautological-type-limit-compare',
|
||||||
'-Wno-psabi',
|
'-Wno-typedef-redefinition',
|
||||||
'-Wno-gnu-variable-sized-type-not-at-end',
|
|
||||||
'-Wshadow=local',
|
|
||||||
]
|
]
|
||||||
|
|
||||||
if host_os != 'darwin'
|
if host_os != 'darwin'
|
||||||
|
Reference in New Issue
Block a user