diff options
author | David Seifert <soap@gentoo.org> | 2019-07-14 09:54:19 +0200 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2019-07-14 15:12:16 +0000 |
commit | fcf27c2a2d36f81168bd14d933799c171d2ffb81 (patch) | |
tree | dedcdaf84c0f56efe346fb4a39a81a52c27ba1ac /mesonbuild | |
parent | 6813ef1e2424cdcfc0811bb0c7b3d2efc996fd36 (diff) | |
download | meson-fcf27c2a2d36f81168bd14d933799c171d2ffb81.zip meson-fcf27c2a2d36f81168bd14d933799c171d2ffb81.tar.gz meson-fcf27c2a2d36f81168bd14d933799c171d2ffb81.tar.bz2 |
Do not fail on passing `-Werror=unused-parameter` from environment
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/compilers/c.py | 2 | ||||
-rw-r--r-- | mesonbuild/compilers/clike.py | 20 | ||||
-rw-r--r-- | mesonbuild/compilers/cpp.py | 2 | ||||
-rw-r--r-- | mesonbuild/compilers/objc.py | 2 | ||||
-rw-r--r-- | mesonbuild/compilers/objcpp.py | 2 |
5 files changed, 14 insertions, 14 deletions
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py index fb2f8c5..deba5a3 100644 --- a/mesonbuild/compilers/c.py +++ b/mesonbuild/compilers/c.py @@ -58,7 +58,7 @@ class CCompiler(CLikeCompiler, Compiler): return ['-nostdinc'] def sanity_check(self, work_dir, environment): - code = 'int main(int argc, char **argv) { int class=0; return class; }\n' + code = 'int main() { int class=0; return class; }\n' return self.sanity_check_impl(work_dir, environment, 'sanitycheckc.c', code) def has_header_symbol(self, hname, symbol, prefix, env, *, extra_args=None, dependencies=None): diff --git a/mesonbuild/compilers/clike.py b/mesonbuild/compilers/clike.py index 16783fa..c2cee5f 100644 --- a/mesonbuild/compilers/clike.py +++ b/mesonbuild/compilers/clike.py @@ -295,7 +295,7 @@ class CLikeCompiler: raise mesonlib.EnvironmentException('Executables created by {0} compiler {1} are not runnable.'.format(self.language, self.name_string())) def sanity_check(self, work_dir, environment): - code = 'int main(int argc, char **argv) { int class=0; return class; }\n' + code = 'int main() { int class=0; return class; }\n' return self.sanity_check_impl(work_dir, environment, 'sanitycheckc.c', code) def check_header(self, hname, prefix, env, *, extra_args=None, dependencies=None): @@ -494,7 +494,7 @@ class CLikeCompiler: fargs = {'prefix': prefix, 'expression': expression} t = '''#include<stdio.h> {prefix} - int main(int argc, char **argv) {{ + int main() {{ printf("%ld\\n", (long)({expression})); return 0; }};''' @@ -512,7 +512,7 @@ class CLikeCompiler: fargs = {'prefix': prefix, 'type': typename} t = '''#include <stdio.h> {prefix} - int main(int argc, char **argv) {{ + int main() {{ {type} something; return 0; }}''' @@ -530,7 +530,7 @@ class CLikeCompiler: dependencies=dependencies) t = '''#include<stdio.h> {prefix} - int main(int argc, char **argv) {{ + int main() {{ printf("%ld\\n", (long)(sizeof({type}))); return 0; }};''' @@ -548,7 +548,7 @@ class CLikeCompiler: fargs = {'prefix': prefix, 'type': typename} t = '''#include <stdio.h> {prefix} - int main(int argc, char **argv) {{ + int main() {{ {type} something; }}''' if not self.compiles(t.format(**fargs), env, extra_args=extra_args, @@ -576,7 +576,7 @@ class CLikeCompiler: char c; {type} target; }}; - int main(int argc, char **argv) {{ + int main() {{ printf("%d", (int)offsetof(struct tmp, target)); return 0; }}''' @@ -626,7 +626,7 @@ class CLikeCompiler: fargs = {'prefix': prefix, 'f': fname, 'cast': cast, 'fmt': fmt} code = '''{prefix} #include <stdio.h> - int main(int argc, char *argv[]) {{ + int main() {{ printf ("{fmt}", {cast} {f}()); }}'''.format(**fargs) res = self.run(code, env, extra_args=extra_args, dependencies=dependencies) @@ -1026,7 +1026,7 @@ class CLikeCompiler: return value[:] def find_library(self, libname, env, extra_dirs, libtype: LibType = LibType.PREFER_SHARED): - code = 'int main(int argc, char **argv) { return 0; }' + code = 'int main() { return 0; }' return self.find_library_impl(libname, env, extra_dirs, code, libtype) def find_framework_paths(self, env): @@ -1056,7 +1056,7 @@ class CLikeCompiler: return paths def find_framework_real(self, name, env, extra_dirs, allow_system): - code = 'int main(int argc, char **argv) { return 0; }' + code = 'int main() { return 0; }' link_args = [] for d in extra_dirs: link_args += ['-F' + d] @@ -1139,7 +1139,7 @@ class CLikeCompiler: args = fatal_warnings_args + args args = self.linker_to_compiler_args(args) - code = 'int main(int argc, char **argv) { return 0; }' + code = 'int main() { return 0; }' return self.has_arguments(args, env, code, mode='link') @staticmethod diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py index 16269be..c0b6812 100644 --- a/mesonbuild/compilers/cpp.py +++ b/mesonbuild/compilers/cpp.py @@ -69,7 +69,7 @@ class CPPCompiler(CLikeCompiler, Compiler): return ['-nostdinc++'] def sanity_check(self, work_dir, environment): - code = 'class breakCCompiler;int main(int argc, char **argv) { return 0; }\n' + code = 'class breakCCompiler;int main() { return 0; }\n' return self.sanity_check_impl(work_dir, environment, 'sanitycheckcpp.cc', code) def get_compiler_check_args(self): diff --git a/mesonbuild/compilers/objc.py b/mesonbuild/compilers/objc.py index b45f75b..9730ea4 100644 --- a/mesonbuild/compilers/objc.py +++ b/mesonbuild/compilers/objc.py @@ -40,7 +40,7 @@ class ObjCCompiler(CLikeCompiler, Compiler): extra_flags += environment.coredata.get_external_link_args(self.for_machine, self.language) with open(source_name, 'w') as ofile: ofile.write('#import<stdio.h>\n' - 'int main(int argc, char **argv) { return 0; }\n') + 'int main() { return 0; }\n') pc = subprocess.Popen(self.exelist + extra_flags + [source_name, '-o', binary_name]) pc.wait() if pc.returncode != 0: diff --git a/mesonbuild/compilers/objcpp.py b/mesonbuild/compilers/objcpp.py index f74bbd8..f89235e 100644 --- a/mesonbuild/compilers/objcpp.py +++ b/mesonbuild/compilers/objcpp.py @@ -41,7 +41,7 @@ class ObjCPPCompiler(CLikeCompiler, Compiler): with open(source_name, 'w') as ofile: ofile.write('#import<stdio.h>\n' 'class MyClass;' - 'int main(int argc, char **argv) { return 0; }\n') + 'int main() { return 0; }\n') pc = subprocess.Popen(self.exelist + extra_flags + [source_name, '-o', binary_name]) pc.wait() if pc.returncode != 0: |