From e459fd2f53dfe13297630cc04e4a420f12668f8a Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Sun, 25 Sep 2016 07:53:49 +0530 Subject: compilers: Fall back to -pedantic with older GCC Fixes https://github.com/mesonbuild/meson/issues/242 --- mesonbuild/compilers.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py index 4ee94d6..aafaa7f 100644 --- a/mesonbuild/compilers.py +++ b/mesonbuild/compilers.py @@ -1971,6 +1971,14 @@ class GnuCompiler: return gnu_color_args[colortype][:] return [] + def get_warn_args(self, level): + args = super().get_warn_args(level) + if mesonlib.version_compare(self.version, '<4.8.0') and '-Wpedantic' in args: + # -Wpedantic was added in 4.8.0 + # https://gcc.gnu.org/gcc-4.8/changes.html + args[args.index('-Wpedantic')] = '-pedantic' + return args + def get_pic_args(self): if self.gcc_type == GCC_MINGW: return [] # On Window gcc defaults to fpic being always on. -- cgit v1.1 From e8dc13248eda9dda04cffdc68609e55989328ea3 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Sun, 25 Sep 2016 09:41:07 +0530 Subject: compilers: Fix typo in visual studio warning argument --- mesonbuild/compilers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py index aafaa7f..8772803 100644 --- a/mesonbuild/compilers.py +++ b/mesonbuild/compilers.py @@ -1731,7 +1731,7 @@ class VisualStudioCCompiler(CCompiler): self.always_args = ['/nologo', '/showIncludes'] self.warn_args = {'1': ['/W2'], '2': ['/W3'], - '3': ['/w4']} + '3': ['/W4']} self.base_options = ['b_pch'] # FIXME add lto, pgo and the like def get_always_args(self): -- cgit v1.1