summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
authorAndré Draszik <adraszik@tycoint.com>2017-10-06 13:24:08 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-11-05 22:39:48 +0000
commit9f981b48cf530836cefc36bf2a7d4aaea4903679 (patch)
treebf25302f4a7b53aa9802a5795875ef7a77489f74 /meta/recipes-devtools
parent7ca04fef1b324b7fc6e8c5bbddcd41617cc5e5c6 (diff)
downloadpoky-9f981b48cf530836cefc36bf2a7d4aaea4903679.tar.gz
json-c: backport patch to fix gcc7 compilation
(The native version might be being built using gcc-7) We can't cherry-pick a commit from master, as master has upgraded json-c at the same time as applying this patch, see commit ccf630e78aad ("json-c: Upgrade to 0.12.1 release") (From OE-Core rev: 9b0cb8149ce82c0e6fa3054b54d35e9bf1353bf0) Signed-off-by: André Draszik <adraszik@tycoint.com> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r--meta/recipes-devtools/json-c/json-c/0001-Add-FALLTHRU-comment-to-handle-GCC7-warnings.patch77
-rw-r--r--meta/recipes-devtools/json-c/json-c_0.12.bb1
2 files changed, 78 insertions, 0 deletions
diff --git a/meta/recipes-devtools/json-c/json-c/0001-Add-FALLTHRU-comment-to-handle-GCC7-warnings.patch b/meta/recipes-devtools/json-c/json-c/0001-Add-FALLTHRU-comment-to-handle-GCC7-warnings.patch
new file mode 100644
index 0000000000..df3b6002aa
--- /dev/null
+++ b/meta/recipes-devtools/json-c/json-c/0001-Add-FALLTHRU-comment-to-handle-GCC7-warnings.patch
@@ -0,0 +1,77 @@
1From 9522ac8e5d5b20a472f3ffc356d388d36f7f582c Mon Sep 17 00:00:00 2001
2From: marxin <mliska@suse.cz>
3Date: Tue, 21 Mar 2017 08:42:11 +0100
4Subject: [PATCH] Add FALLTHRU comment to handle GCC7 warnings.
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9---
10Upstream-Status: Backport [https://github.com/json-c/json-c/commit/014924ba899f659917bb64392bbff7d3c803afc2]
11Signed-off-by: André Draszik <adraszik@tycoint.com>
12
13 json_object.c | 1 +
14 json_tokener.c | 1 +
15 linkhash.c | 22 +++++++++++-----------
16 3 files changed, 13 insertions(+), 11 deletions(-)
17
18diff --git a/json_object.c b/json_object.c
19index 6cc73bc..77e8b21 100644
20--- a/json_object.c
21+++ b/json_object.c
22@@ -552,6 +552,7 @@ int64_t json_object_get_int64(struct json_object *jso)
23 return jso->o.c_boolean;
24 case json_type_string:
25 if (json_parse_int64(jso->o.c_string.str, &cint) == 0) return cint;
26+ /* FALLTHRU */
27 default:
28 return 0;
29 }
30diff --git a/json_tokener.c b/json_tokener.c
31index 7fa32ae..b32d657 100644
32--- a/json_tokener.c
33+++ b/json_tokener.c
34@@ -306,6 +306,7 @@ struct json_object* json_tokener_parse_ex(struct json_tokener *tok,
35 tok->err = json_tokener_error_parse_unexpected;
36 goto out;
37 }
38+ /* FALLTHRU */
39 case '"':
40 state = json_tokener_state_string;
41 printbuf_reset(tok->pb);
42diff --git a/linkhash.c b/linkhash.c
43index 712c387..74e3b0f 100644
44--- a/linkhash.c
45+++ b/linkhash.c
46@@ -376,17 +376,17 @@ static uint32_t hashlittle( const void *key, size_t length, uint32_t initval)
47 /*-------------------------------- last block: affect all 32 bits of (c) */
48 switch(length) /* all the case statements fall through */
49 {
50- case 12: c+=((uint32_t)k[11])<<24;
51- case 11: c+=((uint32_t)k[10])<<16;
52- case 10: c+=((uint32_t)k[9])<<8;
53- case 9 : c+=k[8];
54- case 8 : b+=((uint32_t)k[7])<<24;
55- case 7 : b+=((uint32_t)k[6])<<16;
56- case 6 : b+=((uint32_t)k[5])<<8;
57- case 5 : b+=k[4];
58- case 4 : a+=((uint32_t)k[3])<<24;
59- case 3 : a+=((uint32_t)k[2])<<16;
60- case 2 : a+=((uint32_t)k[1])<<8;
61+ case 12: c+=((uint32_t)k[11])<<24; /* FALLTHRU */
62+ case 11: c+=((uint32_t)k[10])<<16; /* FALLTHRU */
63+ case 10: c+=((uint32_t)k[9])<<8; /* FALLTHRU */
64+ case 9 : c+=k[8]; /* FALLTHRU */
65+ case 8 : b+=((uint32_t)k[7])<<24; /* FALLTHRU */
66+ case 7 : b+=((uint32_t)k[6])<<16; /* FALLTHRU */
67+ case 6 : b+=((uint32_t)k[5])<<8; /* FALLTHRU */
68+ case 5 : b+=k[4]; /* FALLTHRU */
69+ case 4 : a+=((uint32_t)k[3])<<24; /* FALLTHRU */
70+ case 3 : a+=((uint32_t)k[2])<<16; /* FALLTHRU */
71+ case 2 : a+=((uint32_t)k[1])<<8; /* FALLTHRU */
72 case 1 : a+=k[0];
73 break;
74 case 0 : return c;
75--
762.14.1
77
diff --git a/meta/recipes-devtools/json-c/json-c_0.12.bb b/meta/recipes-devtools/json-c/json-c_0.12.bb
index a15455c9bf..072c092c0e 100644
--- a/meta/recipes-devtools/json-c/json-c_0.12.bb
+++ b/meta/recipes-devtools/json-c/json-c_0.12.bb
@@ -7,6 +7,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=de54b60fbbc35123ba193fea8ee216f2"
7SRC_URI = "https://s3.amazonaws.com/json-c_releases/releases/${BP}.tar.gz \ 7SRC_URI = "https://s3.amazonaws.com/json-c_releases/releases/${BP}.tar.gz \
8 file://0001-json_tokener-requires-INF-and-NAN.patch \ 8 file://0001-json_tokener-requires-INF-and-NAN.patch \
9 file://0001-Link-against-libm-when-needed.patch \ 9 file://0001-Link-against-libm-when-needed.patch \
10 file://0001-Add-FALLTHRU-comment-to-handle-GCC7-warnings.patch \
10 " 11 "
11 12
12SRC_URI[md5sum] = "3ca4bbb881dfc4017e8021b5e0a8c491" 13SRC_URI[md5sum] = "3ca4bbb881dfc4017e8021b5e0a8c491"