diff options
| -rw-r--r-- | meta/recipes-devtools/meson/meson.inc | 1 | ||||
| -rw-r--r-- | meta/recipes-devtools/meson/meson/0001-Fix-missing-return-statements-that-are-seen-with-Wer.patch | 100 |
2 files changed, 101 insertions, 0 deletions
diff --git a/meta/recipes-devtools/meson/meson.inc b/meta/recipes-devtools/meson/meson.inc index 662368e219..14e5f8a610 100644 --- a/meta/recipes-devtools/meson/meson.inc +++ b/meta/recipes-devtools/meson/meson.inc | |||
| @@ -16,6 +16,7 @@ SRC_URI = "https://github.com/mesonbuild/meson/releases/download/${PV}/meson-${P | |||
| 16 | file://0001-mesonbuild-environment.py-check-environment-for-vari.patch \ | 16 | file://0001-mesonbuild-environment.py-check-environment-for-vari.patch \ |
| 17 | file://0001-modules-python.py-do-not-substitute-python-s-install.patch \ | 17 | file://0001-modules-python.py-do-not-substitute-python-s-install.patch \ |
| 18 | file://vala-cross-compile.patch \ | 18 | file://vala-cross-compile.patch \ |
| 19 | file://0001-Fix-missing-return-statements-that-are-seen-with-Wer.patch \ | ||
| 19 | " | 20 | " |
| 20 | SRC_URI[sha256sum] = "f27b7a60f339ba66fe4b8f81f0d1072e090a08eabbd6aa287683b2c2b9dd2d82" | 21 | SRC_URI[sha256sum] = "f27b7a60f339ba66fe4b8f81f0d1072e090a08eabbd6aa287683b2c2b9dd2d82" |
| 21 | SRC_URI[md5sum] = "48787e391ec5c052799a3dd491f73909" | 22 | SRC_URI[md5sum] = "48787e391ec5c052799a3dd491f73909" |
diff --git a/meta/recipes-devtools/meson/meson/0001-Fix-missing-return-statements-that-are-seen-with-Wer.patch b/meta/recipes-devtools/meson/meson/0001-Fix-missing-return-statements-that-are-seen-with-Wer.patch new file mode 100644 index 0000000000..16c6d90761 --- /dev/null +++ b/meta/recipes-devtools/meson/meson/0001-Fix-missing-return-statements-that-are-seen-with-Wer.patch | |||
| @@ -0,0 +1,100 @@ | |||
| 1 | From 15f44be1c7f71cb0a8c6863917acbbc301c621fe Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Martin Liska <mliska@suse.cz> | ||
| 3 | Date: Mon, 15 Jul 2019 10:06:17 +0200 | ||
| 4 | Subject: [PATCH] Fix missing return statements that are seen with | ||
| 5 | -Werror=return-type. | ||
| 6 | |||
| 7 | Error example: | ||
| 8 | |||
| 9 | Code: | ||
| 10 | |||
| 11 | #include <locale.h> | ||
| 12 | int main () { | ||
| 13 | /* If it's not defined as a macro, try to use as a symbol */ | ||
| 14 | #ifndef LC_MESSAGES | ||
| 15 | LC_MESSAGES; | ||
| 16 | #endif | ||
| 17 | } | ||
| 18 | Compiler stdout: | ||
| 19 | |||
| 20 | Compiler stderr: | ||
| 21 | In file included from /usr/include/locale.h:25, | ||
| 22 | from /tmp/tmpep_i4iwg/testfile.c:2: | ||
| 23 | /usr/include/features.h:382:4: warning: #warning _FORTIFY_SOURCE | ||
| 24 | requires compiling with optimization (-O) [-Wcpp] | ||
| 25 | 382 | # warning _FORTIFY_SOURCE requires compiling with optimization | ||
| 26 | (-O) | ||
| 27 | | ^~~~~~~ | ||
| 28 | /tmp/tmpep_i4iwg/testfile.c: In function 'main': | ||
| 29 | /tmp/tmpep_i4iwg/testfile.c:8:9: error: control reaches end of non-void | ||
| 30 | function [-Werror=return-type] | ||
| 31 | 8 | } | ||
| 32 | | ^ | ||
| 33 | cc1: some warnings being treated as errors | ||
| 34 | |||
| 35 | Upstream-Status: Backport | ||
| 36 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
| 37 | --- | ||
| 38 | mesonbuild/compilers/c.py | 1 + | ||
| 39 | mesonbuild/compilers/clike.py | 5 +++++ | ||
| 40 | 2 files changed, 6 insertions(+) | ||
| 41 | |||
| 42 | diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py | ||
| 43 | index 3b58a076..9ef92077 100644 | ||
| 44 | --- a/mesonbuild/compilers/c.py | ||
| 45 | +++ b/mesonbuild/compilers/c.py | ||
| 46 | @@ -70,6 +70,7 @@ class CCompiler(CLikeCompiler, Compiler): | ||
| 47 | #ifndef {symbol} | ||
| 48 | {symbol}; | ||
| 49 | #endif | ||
| 50 | + return 0; | ||
| 51 | }}''' | ||
| 52 | return self.compiles(t.format(**fargs), env, extra_args=extra_args, | ||
| 53 | dependencies=dependencies) | ||
| 54 | diff --git a/mesonbuild/compilers/clike.py b/mesonbuild/compilers/clike.py | ||
| 55 | index 83f67591..f9cbeabd 100644 | ||
| 56 | --- a/mesonbuild/compilers/clike.py | ||
| 57 | +++ b/mesonbuild/compilers/clike.py | ||
| 58 | @@ -375,6 +375,7 @@ class CLikeCompiler: | ||
| 59 | #ifndef {symbol} | ||
| 60 | {symbol}; | ||
| 61 | #endif | ||
| 62 | + return 0; | ||
| 63 | }}''' | ||
| 64 | return self.compiles(t.format(**fargs), env, extra_args=extra_args, | ||
| 65 | dependencies=dependencies) | ||
| 66 | @@ -554,6 +555,7 @@ class CLikeCompiler: | ||
| 67 | {prefix} | ||
| 68 | int main(int argc, char **argv) {{ | ||
| 69 | {type} something; | ||
| 70 | + return 0; | ||
| 71 | }}''' | ||
| 72 | if not self.compiles(t.format(**fargs), env, extra_args=extra_args, | ||
| 73 | dependencies=dependencies)[0]: | ||
| 74 | @@ -589,6 +591,7 @@ class CLikeCompiler: | ||
| 75 | {prefix} | ||
| 76 | int main(int argc, char **argv) {{ | ||
| 77 | {type} something; | ||
| 78 | + return 0; | ||
| 79 | }}''' | ||
| 80 | if not self.compiles(t.format(**fargs), env, extra_args=extra_args, | ||
| 81 | dependencies=dependencies)[0]: | ||
| 82 | @@ -667,6 +670,7 @@ class CLikeCompiler: | ||
| 83 | #include <stdio.h> | ||
| 84 | int main(int argc, char *argv[]) {{ | ||
| 85 | printf ("{fmt}", {cast} {f}()); | ||
| 86 | + return 0; | ||
| 87 | }}'''.format(**fargs) | ||
| 88 | res = self.run(code, env, extra_args=extra_args, dependencies=dependencies) | ||
| 89 | if not res.compiled: | ||
| 90 | @@ -819,6 +823,7 @@ class CLikeCompiler: | ||
| 91 | #error "No definition for __builtin_{func} found in the prefix" | ||
| 92 | #endif | ||
| 93 | #endif | ||
| 94 | + return 0; | ||
| 95 | }}''' | ||
| 96 | return self.links(t.format(**fargs), env, extra_args=extra_args, | ||
| 97 | dependencies=dependencies) | ||
| 98 | -- | ||
| 99 | 2.17.1 | ||
| 100 | |||
