diff options
Diffstat (limited to 'recipes-devtools/elfutils/elfutils-0.148/0001-Make-it-compile-with-GCC-7.patch')
-rw-r--r-- | recipes-devtools/elfutils/elfutils-0.148/0001-Make-it-compile-with-GCC-7.patch | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/recipes-devtools/elfutils/elfutils-0.148/0001-Make-it-compile-with-GCC-7.patch b/recipes-devtools/elfutils/elfutils-0.148/0001-Make-it-compile-with-GCC-7.patch new file mode 100644 index 0000000..a43508f --- /dev/null +++ b/recipes-devtools/elfutils/elfutils-0.148/0001-Make-it-compile-with-GCC-7.patch | |||
@@ -0,0 +1,43 @@ | |||
1 | From 9529f012a1cfdae36aedeab8ccd790c875ae7f73 Mon Sep 17 00:00:00 2001 | ||
2 | From: Peter Kjellerstedt <pkj@axis.com> | ||
3 | Date: Sat, 16 Sep 2017 15:09:23 +0200 | ||
4 | Subject: [PATCH 1/2] Make it compile with GCC 7 | ||
5 | |||
6 | This avoids the following errors: | ||
7 | |||
8 | src/readelf.c: In function 'register_info': | ||
9 | src/readelf.c:4481:30: warning: 'sizeof' on array function parameter | ||
10 | 'name' will return size of 'char *' [-Wsizeof-array-argument] | ||
11 | snprintf (name, sizeof name, "reg%u", loc->regno); | ||
12 | ^~~~ | ||
13 | src/readelf.c:4472:14: note: declared here | ||
14 | char name[REGNAMESZ], int *bits, int *type) | ||
15 | ^~~~ | ||
16 | rc/readelf.c:4481:30: warning: argument to 'sizeof' in 'snprintf' call | ||
17 | is the same expression as the destination; did you mean to provide an | ||
18 | explicit length? [-Wsizeof-pointer-memaccess] | ||
19 | snprintf (name, sizeof name, "reg%u", loc->regno); | ||
20 | ^~~~ | ||
21 | |||
22 | Upstream-Status: Inappropriate [legacy version] | ||
23 | Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> | ||
24 | --- | ||
25 | src/readelf.c | 2 +- | ||
26 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
27 | |||
28 | diff --git a/src/readelf.c b/src/readelf.c | ||
29 | index bf622a6..ba0607b 100644 | ||
30 | --- a/src/readelf.c | ||
31 | +++ b/src/readelf.c | ||
32 | @@ -4478,7 +4478,7 @@ register_info (Ebl *ebl, unsigned int regno, const Ebl_Register_Location *loc, | ||
33 | bits ?: &ignore, type ?: &ignore); | ||
34 | if (n <= 0) | ||
35 | { | ||
36 | - snprintf (name, sizeof name, "reg%u", loc->regno); | ||
37 | + snprintf (name, REGNAMESZ, "reg%u", loc->regno); | ||
38 | if (bits != NULL) | ||
39 | *bits = loc->bits; | ||
40 | if (type != NULL) | ||
41 | -- | ||
42 | 2.12.0 | ||
43 | |||