diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2020-11-12 15:30:44 -0500 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2020-11-13 17:45:40 +0200 |
commit | aeb995fdc649d4e3df83330ea2afebbf117543df (patch) | |
tree | 55d570ee9e22b57ece9f0040f36227466173c03d | |
parent | 21897a10ca0295f65f158ed3cbac396bc5adbb54 (diff) | |
download | meson-aeb995fdc649d4e3df83330ea2afebbf117543df.zip meson-aeb995fdc649d4e3df83330ea2afebbf117543df.tar.gz meson-aeb995fdc649d4e3df83330ea2afebbf117543df.tar.bz2 |
Do not warn when -Wpedantic is added as a project argument.
The only way to add it via warning_level is top opt in to -Wextra too.
But this is often not really desirable, since -Wextra is not stable --
it changes its meaning every compiler release, thus mysteriously adding
new warnings. Furthermore, it's not really the same kind of warning -- a
pedantic warning is always correct that your code is wrong, but defines
wrongness as "not per the portable standard". Unlike -Wextra it doesn't
try to judge your code to see if you're doing something that is "often
not what you meant", but is prone to false positives.
Really, we need different *kinds* of warning levels, possibly as an
array -- not just a monotonically increasing number. But since there's
currently nothing flexible enough to specify -Wpedantic without -Wextra,
we will just remove the warning for the former, and let people add it to
their project arguments in peace.
-rw-r--r-- | mesonbuild/interpreter.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index 83df514..138f6f8 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -4643,7 +4643,11 @@ different subdirectory. self.add_project_arguments(node, self.build.projects_link_args[for_machine], args, kwargs) def warn_about_builtin_args(self, args): - warnargs = ('/W1', '/W2', '/W3', '/W4', '/Wall', '-Wall', '-Wextra', '-Wpedantic') + # -Wpedantic is deliberately not included, since some people want to use it but not use -Wextra + # see e.g. + # https://github.com/mesonbuild/meson/issues/3275#issuecomment-641354956 + # https://github.com/mesonbuild/meson/issues/3742 + warnargs = ('/W1', '/W2', '/W3', '/W4', '/Wall', '-Wall', '-Wextra') optargs = ('-O0', '-O2', '-O3', '-Os', '/O1', '/O2', '/Os') for arg in args: if arg in warnargs: |