summaryrefslogtreecommitdiffstats
path: root/meson/suppressions
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-04-30 18:27:55 -0400
committerDavid Robillard <d@drobilla.net>2023-05-01 13:15:50 -0400
commited6ae993e3889e2243cb0387e5d53398b118749d (patch)
treee9b0d4861c55793aabda59556ef910eab59a825e /meson/suppressions
parentf1f063c8e170b2a6350eedf68c4859b974d85d5e (diff)
downloadsratom-ed6ae993e3889e2243cb0387e5d53398b118749d.tar.gz
sratom-ed6ae993e3889e2243cb0387e5d53398b118749d.tar.bz2
sratom-ed6ae993e3889e2243cb0387e5d53398b118749d.zip
Replace strict option with new meson warning level
Diffstat (limited to 'meson/suppressions')
-rw-r--r--meson/suppressions/meson.build133
1 files changed, 74 insertions, 59 deletions
diff --git a/meson/suppressions/meson.build b/meson/suppressions/meson.build
index 470c761..6c04801 100644
--- a/meson/suppressions/meson.build
+++ b/meson/suppressions/meson.build
@@ -1,78 +1,93 @@
-# Copyright 2020-2022 David Robillard <d@drobilla.net>
+# Copyright 2020-2023 David Robillard <d@drobilla.net>
# SPDX-License-Identifier: 0BSD OR ISC
-# Project-specific warning suppressions.
-#
-# This should be used in conjunction with the generic "warnings" sibling that
-# enables all reasonable warnings for the compiler. It lives here just to keep
-# the top-level meson.build more readable.
+# Project-specific warning suppressions
+
+warning_level = get_option('warning_level')
#####
# C #
#####
-if is_variable('cc')
- c_suppressions = []
-
- if get_option('strict')
- if cc.get_id() == 'clang'
- c_suppressions += [
- '-Wno-cast-align',
- '-Wno-cast-qual',
- '-Wno-declaration-after-statement',
- '-Wno-documentation-unknown-command',
- '-Wno-double-promotion',
- '-Wno-float-conversion',
- '-Wno-implicit-float-conversion',
- '-Wno-implicit-int-conversion',
- '-Wno-nullability-extension',
- '-Wno-nullable-to-nonnull-conversion',
- '-Wno-padded',
- '-Wno-shorten-64-to-32',
- '-Wno-sign-conversion',
- ]
+c_suppressions = []
- if host_machine.system() == 'windows'
- c_suppressions += [
- '-Wno-deprecated-declarations',
- '-Wno-format-nonliteral',
- ]
- endif
+if cc.get_id() == 'clang'
+ if warning_level == 'everything'
+ c_suppressions += [
+ '-Wno-cast-align',
+ '-Wno-cast-qual',
+ '-Wno-declaration-after-statement',
+ '-Wno-documentation-unknown-command',
+ '-Wno-double-promotion',
+ '-Wno-float-conversion',
+ '-Wno-implicit-float-conversion',
+ '-Wno-implicit-int-conversion',
+ '-Wno-nullable-to-nonnull-conversion',
+ '-Wno-padded',
+ '-Wno-shorten-64-to-32',
+ '-Wno-sign-conversion',
+ ]
- elif cc.get_id() == 'gcc'
+ if host_machine.system() == 'windows'
c_suppressions += [
- '-Wno-cast-align',
- '-Wno-cast-qual',
- '-Wno-conversion',
- '-Wno-inline',
- '-Wno-padded',
- '-Wno-suggest-attribute=pure',
- '-Wno-unsuffixed-float-constants',
- '-Wno-unused-const-variable',
+ '-Wno-deprecated-declarations',
+ '-Wno-format-nonliteral',
]
+ endif
+ endif
+
+ if warning_level in ['everything', '3']
+ c_suppressions += [
+ '-Wno-nullability-extension',
+ ]
+ endif
- if host_machine.system() =='windows'
- c_suppressions += [
- '-Wno-suggest-attribute=format',
- ]
- endif
+elif cc.get_id() == 'gcc'
+ if warning_level == 'everything'
+ c_suppressions += [
+ '-Wno-cast-align',
+ '-Wno-cast-qual',
+ '-Wno-conversion',
+ '-Wno-inline',
+ '-Wno-padded',
+ '-Wno-suggest-attribute=pure',
+ '-Wno-unsuffixed-float-constants',
+ '-Wno-unused-const-variable',
+ ]
- elif cc.get_id() == 'msvc'
+ if host_machine.system() =='windows'
c_suppressions += [
- '/wd4242', # conversion, possible loss of data
- '/wd4244', # conversion from floating point, possible loss of data
- '/wd4267', # conversion from size_t, possible loss of data
- '/wd4365', # signed/unsigned mismatch
- '/wd4514', # unreferenced inline function has been removed
- '/wd4706', # assignment within conditional expression
- '/wd4710', # function not inlined
- '/wd4711', # function selected for automatic inline expansion
- '/wd4820', # padding added after construct
- '/wd4996', # function or variable may be unsafe
- '/wd5045', # will insert Spectre mitigation for memory load
+ '-Wno-suggest-attribute=format',
]
endif
endif
- c_suppressions = cc.get_supported_arguments(c_suppressions)
+elif cc.get_id() == 'msvc'
+ if warning_level == 'everything'
+ c_suppressions += [
+ '/wd4242', # conversion, possible loss of data
+ '/wd4365', # signed/unsigned mismatch
+ '/wd4514', # unreferenced inline function has been removed
+ '/wd4706', # assignment within conditional expression
+ '/wd4710', # function not inlined
+ '/wd4711', # function selected for automatic inline expansion
+ '/wd4820', # padding added after construct
+ '/wd5045', # will insert Spectre mitigation for memory load
+ ]
+ endif
+
+ if warning_level in ['everything', '3', '2']
+ c_suppressions += [
+ '/wd4267', # conversion from size_t, possible loss of data
+ '/wd4996', # function or variable may be unsafe
+ ]
+ endif
+
+ if warning_level in ['everything', '3', '2', '1']
+ c_suppressions += [
+ '/wd4244', # conversion from floating point, possible loss of data
+ ]
+ endif
endif
+
+c_suppressions = cc.get_supported_arguments(c_suppressions)