Merge pull request #5654 from marxin/fix-return-type-warnings

Fix missing return statements that are seen with -Werror=return-type.
pull/5664/head
Michael Hirsch, Ph.D 5 years ago committed by GitHub
commit 1b2d54a085
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      mesonbuild/compilers/c.py
  2. 4
      mesonbuild/compilers/mixins/clike.py

@ -67,6 +67,7 @@ class CCompiler(CLikeCompiler, Compiler):
#ifndef {symbol} #ifndef {symbol}
{symbol}; {symbol};
#endif #endif
return 0;
}}''' }}'''
return self.compiles(t.format(**fargs), env, extra_args=extra_args, return self.compiles(t.format(**fargs), env, extra_args=extra_args,
dependencies=dependencies) dependencies=dependencies)

@ -332,6 +332,7 @@ class CLikeCompiler:
#ifndef {symbol} #ifndef {symbol}
{symbol}; {symbol};
#endif #endif
return 0;
}}''' }}'''
return self.compiles(t.format(**fargs), env, extra_args=extra_args, return self.compiles(t.format(**fargs), env, extra_args=extra_args,
dependencies=dependencies) dependencies=dependencies)
@ -555,6 +556,7 @@ class CLikeCompiler:
{prefix} {prefix}
int main() {{ int main() {{
{type} something; {type} something;
return 0;
}}''' }}'''
if not self.compiles(t.format(**fargs), env, extra_args=extra_args, if not self.compiles(t.format(**fargs), env, extra_args=extra_args,
dependencies=dependencies)[0]: dependencies=dependencies)[0]:
@ -633,6 +635,7 @@ class CLikeCompiler:
#include <stdio.h> #include <stdio.h>
int main() {{ int main() {{
printf ("{fmt}", {cast} {f}()); printf ("{fmt}", {cast} {f}());
return 0;
}}'''.format(**fargs) }}'''.format(**fargs)
res = self.run(code, env, extra_args=extra_args, dependencies=dependencies) res = self.run(code, env, extra_args=extra_args, dependencies=dependencies)
if not res.compiled: if not res.compiled:
@ -785,6 +788,7 @@ class CLikeCompiler:
#error "No definition for __builtin_{func} found in the prefix" #error "No definition for __builtin_{func} found in the prefix"
#endif #endif
#endif #endif
return 0;
}}''' }}'''
return self.links(t.format(**fargs), env, extra_args=extra_args, return self.links(t.format(**fargs), env, extra_args=extra_args,
dependencies=dependencies) dependencies=dependencies)

Loading…
Cancel
Save