# Copyright 2020-2022 David Robillard # SPDX-License-Identifier: CC0-1.0 OR GPL-2.0-or-later # 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. ####### # C++ # ####### if is_variable('cpp') cpp_suppressions = [] if get_option('strict') if cpp.get_id() in ['clang', 'emscripten'] cpp_suppressions = [ '-Wno-double-promotion', '-Wno-enum-float-conversion', '-Wno-float-conversion', '-Wno-float-equal', '-Wno-global-constructors', '-Wno-implicit-float-conversion', '-Wno-old-style-cast', '-Wno-padded', '-Wno-reserved-id-macro', '-Wno-reserved-identifier', '-Wno-shadow-field', '-Wno-shorten-64-to-32', '-Wno-sign-conversion', '-Wno-suggest-destructor-override', '-Wno-suggest-override', '-Wno-unused-macros', '-Wno-unused-parameter', '-Wno-weak-vtables', '-Wno-zero-as-null-pointer-constant', ] elif cpp.get_id() == 'gcc' cpp_suppressions = [ '-Wno-conversion', '-Wno-deprecated-enum-float-conversion', '-Wno-double-promotion', '-Wno-effc++', '-Wno-float-conversion', '-Wno-float-equal', '-Wno-old-style-cast', '-Wno-padded', '-Wno-suggest-attribute=const', '-Wno-suggest-override', '-Wno-switch-default', '-Wno-unused-macros', '-Wno-unused-parameter', '-Wno-volatile', '-Wno-zero-as-null-pointer-constant', ] elif cpp.get_id() == 'msvc' cpp_suppressions = [ '/wd4100', # unreferenced formal parameter '/wd4242', # conversion with possible loss of data '/wd4244', # conversion from unsigned long to float '/wd4305', # truncation from double to float '/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 '/wd5219', # implicit conversion with possible loss of data '/wd5220', # generated copy/move constructors/operators are not trivial ] endif endif cpp_suppressions = cpp.get_supported_arguments(cpp_suppressions) endif