| 1 |
# Copyright 2020-2022 David Robillard <[email protected]> |
| 2 |
# SPDX-License-Identifier: CC0-1.0 OR ISC |
| 3 |
|
| 4 |
# Project-specific warning suppressions. |
| 5 |
# |
| 6 |
# This should be used in conjunction with the generic "warnings" sibling that |
| 7 |
# enables all reasonable warnings for the compiler. It lives here just to keep |
| 8 |
# the top-level meson.build more readable. |
| 9 |
|
| 10 |
##### |
| 11 |
# C # |
| 12 |
##### |
| 13 |
|
| 14 |
if is_variable('cc') |
| 15 |
c_suppressions = [] |
| 16 |
|
| 17 |
if get_option('strict') |
| 18 |
if cc.get_id() in ['clang', 'emscripten'] |
| 19 |
c_suppressions += [ |
| 20 |
'-Wno-bad-function-cast', |
| 21 |
'-Wno-covered-switch-default', |
| 22 |
'-Wno-declaration-after-statement', |
| 23 |
'-Wno-documentation-unknown-command', |
| 24 |
'-Wno-double-promotion', |
| 25 |
'-Wno-extra-semi-stmt', |
| 26 |
'-Wno-float-equal', |
| 27 |
'-Wno-implicit-float-conversion', |
| 28 |
'-Wno-padded', |
| 29 |
'-Wno-shorten-64-to-32', |
| 30 |
'-Wno-sign-conversion', |
| 31 |
'-Wno-unreachable-code-break', |
| 32 |
'-Wno-unused-parameter', |
| 33 |
] |
| 34 |
|
| 35 |
elif cc.get_id() == 'gcc' |
| 36 |
c_suppressions += [ |
| 37 |
'-Wno-bad-function-cast', |
| 38 |
'-Wno-conversion', |
| 39 |
'-Wno-double-promotion', |
| 40 |
'-Wno-float-conversion', |
| 41 |
'-Wno-float-equal', |
| 42 |
'-Wno-format-truncation', |
| 43 |
'-Wno-inline', |
| 44 |
'-Wno-null-dereference', |
| 45 |
'-Wno-padded', |
| 46 |
'-Wno-sign-conversion', |
| 47 |
'-Wno-strict-overflow', |
| 48 |
'-Wno-suggest-attribute=const', |
| 49 |
'-Wno-suggest-attribute=pure', |
| 50 |
'-Wno-switch-default', |
| 51 |
'-Wno-unsuffixed-float-constants', |
| 52 |
'-Wno-unused-parameter', |
| 53 |
] |
| 54 |
endif |
| 55 |
endif |
| 56 |
|
| 57 |
if cc.get_id() == 'gcc' |
| 58 |
c_suppressions += [ |
| 59 |
'-Wno-maybe-uninitialized', |
| 60 |
] |
| 61 |
endif |
| 62 |
|
| 63 |
c_suppressions = cc.get_supported_arguments(c_suppressions) |
| 64 |
endif |