aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorjml1795 <45511331+jml1795@users.noreply.github.com>2019-02-18 17:06:27 -0500
committerJussi Pakkanen <jpakkane@gmail.com>2019-02-19 00:06:27 +0200
commita9e63568fe4a1ef420cdb8bacb85fbf6d621dc0d (patch)
tree5b5159756428d3f403fe45d183412331d715b605 /mesonbuild
parent2cede4d6c9264f725ab57f48e929c748fa1f1ac8 (diff)
downloadmeson-a9e63568fe4a1ef420cdb8bacb85fbf6d621dc0d.zip
meson-a9e63568fe4a1ef420cdb8bacb85fbf6d621dc0d.tar.gz
meson-a9e63568fe4a1ef420cdb8bacb85fbf6d621dc0d.tar.bz2
Add warning level zero
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/compilers/c.py17
-rw-r--r--mesonbuild/compilers/compilers.py11
-rw-r--r--mesonbuild/compilers/cpp.py12
-rw-r--r--mesonbuild/compilers/cuda.py3
-rw-r--r--mesonbuild/compilers/d.py7
-rw-r--r--mesonbuild/compilers/fortran.py18
-rw-r--r--mesonbuild/compilers/objc.py6
-rw-r--r--mesonbuild/compilers/objcpp.py6
-rw-r--r--mesonbuild/coredata.py2
9 files changed, 54 insertions, 28 deletions
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py
index a1a8fb9..3f3aba8 100644
--- a/mesonbuild/compilers/c.py
+++ b/mesonbuild/compilers/c.py
@@ -1152,7 +1152,7 @@ class CCompiler(Compiler):
# flags, so when we are testing a flag like "-Wno-forgotten-towel", also
# check the equivalent enable flag too "-Wforgotten-towel"
if arg.startswith('-Wno-'):
- args.append('-W' + arg[5:])
+ args.append('-W' + arg[5:])
if arg.startswith('-Wl,'):
mlog.warning('{} looks like a linker argument, '
'but has_argument and other similar methods only '
@@ -1209,7 +1209,8 @@ class ClangCCompiler(ClangCompiler, CCompiler):
CCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwargs)
ClangCompiler.__init__(self, compiler_type)
default_warn_args = ['-Wall', '-Winvalid-pch']
- self.warn_args = {'1': default_warn_args,
+ self.warn_args = {'0': [],
+ '1': default_warn_args,
'2': default_warn_args + ['-Wextra'],
'3': default_warn_args + ['-Wextra', '-Wpedantic']}
@@ -1243,7 +1244,8 @@ class ArmclangCCompiler(ArmclangCompiler, CCompiler):
CCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwargs)
ArmclangCompiler.__init__(self, compiler_type)
default_warn_args = ['-Wall', '-Winvalid-pch']
- self.warn_args = {'1': default_warn_args,
+ self.warn_args = {'0': [],
+ '1': default_warn_args,
'2': default_warn_args + ['-Wextra'],
'3': default_warn_args + ['-Wextra', '-Wpedantic']}
@@ -1271,7 +1273,8 @@ class GnuCCompiler(GnuCompiler, CCompiler):
CCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwargs)
GnuCompiler.__init__(self, compiler_type, defines)
default_warn_args = ['-Wall', '-Winvalid-pch']
- self.warn_args = {'1': default_warn_args,
+ self.warn_args = {'0': [],
+ '1': default_warn_args,
'2': default_warn_args + ['-Wextra'],
'3': default_warn_args + ['-Wextra', '-Wpedantic']}
@@ -1341,7 +1344,8 @@ class IntelCCompiler(IntelCompiler, CCompiler):
IntelCompiler.__init__(self, compiler_type)
self.lang_header = 'c-header'
default_warn_args = ['-Wall', '-w3', '-diag-disable:remark']
- self.warn_args = {'1': default_warn_args,
+ self.warn_args = {'0': [],
+ '1': default_warn_args,
'2': default_warn_args + ['-Wextra'],
'3': default_warn_args + ['-Wextra']}
@@ -1383,7 +1387,8 @@ class VisualStudioCCompiler(CCompiler):
# /showIncludes is needed for build dependency tracking in Ninja
# See: https://ninja-build.org/manual.html#_deps
self.always_args = ['/nologo', '/showIncludes']
- self.warn_args = {'1': ['/W2'],
+ self.warn_args = {'0': ['/W1'],
+ '1': ['/W2'],
'2': ['/W3'],
'3': ['/W4']}
self.base_options = ['b_pch', 'b_ndebug', 'b_vscrt'] # FIXME add lto, pgo and the like
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index 3d4cce8..7955f3d 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -21,7 +21,7 @@ from .. import coredata
from .. import mlog
from .. import mesonlib
from ..mesonlib import (
- EnvironmentException, MachineChoice, MesonException, OrderedSet,
+ EnvironmentException, MesonException, OrderedSet,
version_compare, Popen_safe
)
@@ -1636,7 +1636,8 @@ class PGICompiler:
self.compiler_type = compiler_type
default_warn_args = ['-Minform=inform']
- self.warn_args = {'1': default_warn_args,
+ self.warn_args = {'0': [],
+ '1': default_warn_args,
'2': default_warn_args,
'3': default_warn_args}
@@ -1937,7 +1938,8 @@ class ArmCompiler:
self.id = 'arm'
self.compiler_type = compiler_type
default_warn_args = []
- self.warn_args = {'1': default_warn_args,
+ self.warn_args = {'0': [],
+ '1': default_warn_args,
'2': default_warn_args + [],
'3': default_warn_args + []}
# Assembly
@@ -2029,7 +2031,8 @@ class CcrxCompiler:
# Assembly
self.can_compile_suffixes.update('s')
default_warn_args = []
- self.warn_args = {'1': default_warn_args,
+ self.warn_args = {'0': [],
+ '1': default_warn_args,
'2': default_warn_args + [],
'3': default_warn_args + []}
diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py
index bad71f6..67de684 100644
--- a/mesonbuild/compilers/cpp.py
+++ b/mesonbuild/compilers/cpp.py
@@ -135,7 +135,8 @@ class ClangCPPCompiler(ClangCompiler, CPPCompiler):
CPPCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwargs)
ClangCompiler.__init__(self, compiler_type)
default_warn_args = ['-Wall', '-Winvalid-pch', '-Wnon-virtual-dtor']
- self.warn_args = {'1': default_warn_args,
+ self.warn_args = {'0': [],
+ '1': default_warn_args,
'2': default_warn_args + ['-Wextra'],
'3': default_warn_args + ['-Wextra', '-Wpedantic']}
@@ -166,7 +167,8 @@ class ArmclangCPPCompiler(ArmclangCompiler, CPPCompiler):
CPPCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwargs)
ArmclangCompiler.__init__(self, compiler_type)
default_warn_args = ['-Wall', '-Winvalid-pch', '-Wnon-virtual-dtor']
- self.warn_args = {'1': default_warn_args,
+ self.warn_args = {'0': [],
+ '1': default_warn_args,
'2': default_warn_args + ['-Wextra'],
'3': default_warn_args + ['-Wextra', '-Wpedantic']}
@@ -194,7 +196,8 @@ class GnuCPPCompiler(GnuCompiler, CPPCompiler):
CPPCompiler.__init__(self, exelist, version, is_cross, exe_wrap, **kwargs)
GnuCompiler.__init__(self, compiler_type, defines)
default_warn_args = ['-Wall', '-Winvalid-pch', '-Wnon-virtual-dtor']
- self.warn_args = {'1': default_warn_args,
+ self.warn_args = {'0': [],
+ '1': default_warn_args,
'2': default_warn_args + ['-Wextra'],
'3': default_warn_args + ['-Wextra', '-Wpedantic']}
@@ -272,7 +275,8 @@ class IntelCPPCompiler(IntelCompiler, CPPCompiler):
self.lang_header = 'c++-header'
default_warn_args = ['-Wall', '-w3', '-diag-disable:remark',
'-Wpch-messages', '-Wnon-virtual-dtor']
- self.warn_args = {'1': default_warn_args,
+ self.warn_args = {'0': [],
+ '1': default_warn_args,
'2': default_warn_args + ['-Wextra'],
'3': default_warn_args + ['-Wextra']}
diff --git a/mesonbuild/compilers/cuda.py b/mesonbuild/compilers/cuda.py
index 1ea67d3..66dcf33 100644
--- a/mesonbuild/compilers/cuda.py
+++ b/mesonbuild/compilers/cuda.py
@@ -28,7 +28,8 @@ class CudaCompiler(Compiler):
self.exe_wrapper = exe_wrapper
self.id = 'nvcc'
default_warn_args = []
- self.warn_args = {'1': default_warn_args,
+ self.warn_args = {'0': [],
+ '1': default_warn_args,
'2': default_warn_args + ['-Xcompiler=-Wextra'],
'3': default_warn_args + ['-Xcompiler=-Wextra',
'-Xcompiler=-Wpedantic']}
diff --git a/mesonbuild/compilers/d.py b/mesonbuild/compilers/d.py
index afc287f..f1580b6 100644
--- a/mesonbuild/compilers/d.py
+++ b/mesonbuild/compilers/d.py
@@ -498,7 +498,8 @@ class GnuDCompiler(DCompiler):
DCompiler.__init__(self, exelist, version, is_cross, arch, **kwargs)
self.id = 'gcc'
default_warn_args = ['-Wall', '-Wdeprecated']
- self.warn_args = {'1': default_warn_args,
+ self.warn_args = {'0': [],
+ '1': default_warn_args,
'2': default_warn_args + ['-Wextra'],
'3': default_warn_args + ['-Wextra', '-Wpedantic']}
self.base_options = ['b_colorout', 'b_sanitize', 'b_staticpic', 'b_vscrt']
@@ -569,8 +570,10 @@ class LLVMDCompiler(DCompiler):
def get_warn_args(self, level):
if level == '2' or level == '3':
return ['-wi', '-dw']
- else:
+ elif level == '1':
return ['-wi']
+ else:
+ return []
def get_buildtype_args(self, buildtype):
if buildtype != 'plain':
diff --git a/mesonbuild/compilers/fortran.py b/mesonbuild/compilers/fortran.py
index 59c4214..6c260b6 100644
--- a/mesonbuild/compilers/fortran.py
+++ b/mesonbuild/compilers/fortran.py
@@ -280,7 +280,8 @@ class GnuFortranCompiler(GnuCompiler, FortranCompiler):
FortranCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwargs)
GnuCompiler.__init__(self, compiler_type, defines)
default_warn_args = ['-Wall']
- self.warn_args = {'1': default_warn_args,
+ self.warn_args = {'0': [],
+ '1': default_warn_args,
'2': default_warn_args + ['-Wextra'],
'3': default_warn_args + ['-Wextra', '-Wpedantic']}
@@ -307,7 +308,8 @@ class G95FortranCompiler(FortranCompiler):
FortranCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwags)
self.id = 'g95'
default_warn_args = ['-Wall']
- self.warn_args = {'1': default_warn_args,
+ self.warn_args = {'0': [],
+ '1': default_warn_args,
'2': default_warn_args + ['-Wextra'],
'3': default_warn_args + ['-Wextra', '-pedantic']}
@@ -352,7 +354,8 @@ class IntelFortranCompiler(IntelCompiler, FortranCompiler):
IntelCompiler.__init__(self, CompilerType.ICC_STANDARD)
self.id = 'intel'
default_warn_args = ['-warn', 'general', '-warn', 'truncated_source']
- self.warn_args = {'1': default_warn_args,
+ self.warn_args = {'0': [],
+ '1': default_warn_args,
'2': default_warn_args + ['-warn', 'unused'],
'3': ['-warn', 'all']}
@@ -374,7 +377,8 @@ class PathScaleFortranCompiler(FortranCompiler):
FortranCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwags)
self.id = 'pathscale'
default_warn_args = ['-fullwarn']
- self.warn_args = {'1': default_warn_args,
+ self.warn_args = {'0': [],
+ '1': default_warn_args,
'2': default_warn_args,
'3': default_warn_args}
@@ -394,7 +398,8 @@ class FlangFortranCompiler(ClangCompiler, FortranCompiler):
ClangCompiler.__init__(self, CompilerType.CLANG_STANDARD)
self.id = 'flang'
default_warn_args = ['-Minform=inform']
- self.warn_args = {'1': default_warn_args,
+ self.warn_args = {'0': [],
+ '1': default_warn_args,
'2': default_warn_args,
'3': default_warn_args}
@@ -403,7 +408,8 @@ class Open64FortranCompiler(FortranCompiler):
FortranCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwags)
self.id = 'open64'
default_warn_args = ['-fullwarn']
- self.warn_args = {'1': default_warn_args,
+ self.warn_args = {'0': [],
+ '1': default_warn_args,
'2': default_warn_args,
'3': default_warn_args}
diff --git a/mesonbuild/compilers/objc.py b/mesonbuild/compilers/objc.py
index cf58ffb..8dfd0a2 100644
--- a/mesonbuild/compilers/objc.py
+++ b/mesonbuild/compilers/objc.py
@@ -55,7 +55,8 @@ class GnuObjCCompiler(GnuCompiler, ObjCCompiler):
ObjCCompiler.__init__(self, exelist, version, is_cross, exe_wrapper)
GnuCompiler.__init__(self, compiler_type, defines)
default_warn_args = ['-Wall', '-Winvalid-pch']
- self.warn_args = {'1': default_warn_args,
+ self.warn_args = {'0': [],
+ '1': default_warn_args,
'2': default_warn_args + ['-Wextra'],
'3': default_warn_args + ['-Wextra', '-Wpedantic']}
@@ -65,7 +66,8 @@ class ClangObjCCompiler(ClangCompiler, ObjCCompiler):
ObjCCompiler.__init__(self, exelist, version, is_cross, exe_wrapper)
ClangCompiler.__init__(self, compiler_type)
default_warn_args = ['-Wall', '-Winvalid-pch']
- self.warn_args = {'1': default_warn_args,
+ self.warn_args = {'0': [],
+ '1': default_warn_args,
'2': default_warn_args + ['-Wextra'],
'3': default_warn_args + ['-Wextra', '-Wpedantic']}
self.base_options = ['b_pch', 'b_lto', 'b_pgo', 'b_sanitize', 'b_coverage']
diff --git a/mesonbuild/compilers/objcpp.py b/mesonbuild/compilers/objcpp.py
index add888f..e66d730 100644
--- a/mesonbuild/compilers/objcpp.py
+++ b/mesonbuild/compilers/objcpp.py
@@ -53,7 +53,8 @@ class GnuObjCPPCompiler(GnuCompiler, ObjCPPCompiler):
ObjCPPCompiler.__init__(self, exelist, version, is_cross, exe_wrapper)
GnuCompiler.__init__(self, compiler_type, defines)
default_warn_args = ['-Wall', '-Winvalid-pch', '-Wnon-virtual-dtor']
- self.warn_args = {'1': default_warn_args,
+ self.warn_args = {'0': [],
+ '1': default_warn_args,
'2': default_warn_args + ['-Wextra'],
'3': default_warn_args + ['-Wextra', '-Wpedantic']}
@@ -63,7 +64,8 @@ class ClangObjCPPCompiler(ClangCompiler, ObjCPPCompiler):
ObjCPPCompiler.__init__(self, exelist, version, is_cross, exe_wrapper)
ClangCompiler.__init__(self, compiler_type)
default_warn_args = ['-Wall', '-Winvalid-pch', '-Wnon-virtual-dtor']
- self.warn_args = {'1': default_warn_args,
+ self.warn_args = {'0': [],
+ '1': default_warn_args,
'2': default_warn_args + ['-Wextra'],
'3': default_warn_args + ['-Wextra', '-Wpedantic']}
self.base_options = ['b_pch', 'b_lto', 'b_pgo', 'b_sanitize', 'b_coverage']
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py
index a026584..0e11f5c 100644
--- a/mesonbuild/coredata.py
+++ b/mesonbuild/coredata.py
@@ -834,7 +834,7 @@ builtin_options = {
'localstatedir': [UserStringOption, 'Localstate data directory', 'var'],
'sharedstatedir': [UserStringOption, 'Architecture-independent data directory', 'com'],
'werror': [UserBooleanOption, 'Treat warnings as errors', False],
- 'warning_level': [UserComboOption, 'Compiler warning level to use', ['1', '2', '3'], '1'],
+ 'warning_level': [UserComboOption, 'Compiler warning level to use', ['0', '1', '2', '3'], '1'],
'layout': [UserComboOption, 'Build directory layout', ['mirror', 'flat'], 'mirror'],
'default_library': [UserComboOption, 'Default library type', ['shared', 'static', 'both'], 'shared'],
'backend': [UserComboOption, 'Backend to use', backendlist, 'ninja'],