diff options
author | Khem Raj <raj.khem@gmail.com> | 2017-07-26 11:58:14 -0700 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2017-08-13 13:19:40 +0200 |
commit | 9ef4f05cf4a971d1af3b9fc11d215dcf3f8c56d0 (patch) | |
tree | dcbcd9c71d03226a0ff888a72b8392f75a34e816 | |
parent | fb10f1b4d797482375272c92931b7e3d13683a9e (diff) | |
download | meta-openembedded-9ef4f05cf4a971d1af3b9fc11d215dcf3f8c56d0.tar.gz |
ssiapi: Fix build errors found with clang
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
-rw-r--r-- | meta-oe/recipes-support/ssiapi/ssiapi/0001-ssieventmonitor-ordered-comparison-between-pointers-.patch | 39 | ||||
-rw-r--r-- | meta-oe/recipes-support/ssiapi/ssiapi_1.0.1.bb | 3 |
2 files changed, 41 insertions, 1 deletions
diff --git a/meta-oe/recipes-support/ssiapi/ssiapi/0001-ssieventmonitor-ordered-comparison-between-pointers-.patch b/meta-oe/recipes-support/ssiapi/ssiapi/0001-ssieventmonitor-ordered-comparison-between-pointers-.patch new file mode 100644 index 000000000..27df9b5de --- /dev/null +++ b/meta-oe/recipes-support/ssiapi/ssiapi/0001-ssieventmonitor-ordered-comparison-between-pointers-.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | From ea9ecf4bf305f9509d5822b3823658a40162f43c Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Tue, 25 Jul 2017 19:08:21 -0700 | ||
4 | Subject: [PATCH] ssieventmonitor: ordered comparison between pointers and | ||
5 | zero, actually with NULL | ||
6 | |||
7 | Comparing which is large or small between a pointer and NULL | ||
8 | however, looks completely illogical. Ordered comparison of | ||
9 | two valid pointers is legit, but no pointer will be smaller | ||
10 | than NULL , so comparing if a pointer is larger than NULL | ||
11 | simply means if the pointer is not NULL. | ||
12 | |||
13 | Fixes errors found with clang e.g. | ||
14 | |||
15 | | ssieventmonitor.cpp:339:53: error: ordered comparison between pointer and zero ('char *' and 'int') | ||
16 | | if (fgets(nextline, sizeof(nextline) - 1, mdstat) < 0) { | ||
17 | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~ | ||
18 | |||
19 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
20 | --- | ||
21 | tools/ssieventmonitor.cpp | 2 +- | ||
22 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
23 | |||
24 | diff --git a/tools/ssieventmonitor.cpp b/tools/ssieventmonitor.cpp | ||
25 | index f04b8f0..7a00122 100644 | ||
26 | --- a/tools/ssieventmonitor.cpp | ||
27 | +++ b/tools/ssieventmonitor.cpp | ||
28 | @@ -336,7 +336,7 @@ static int _read_mdstat(int fd) | ||
29 | if (!strncmp(line, "md", 2)) { | ||
30 | if (strstr(line, INACTIVE_STR)) { /* possibly container */ | ||
31 | char nextline[1024]; | ||
32 | - if (fgets(nextline, sizeof(nextline) - 1, mdstat) < 0) { | ||
33 | + if (fgets(nextline, sizeof(nextline) - 1, mdstat) != (char *) NULL) { | ||
34 | fclose(mdstat); | ||
35 | return 1; | ||
36 | } | ||
37 | -- | ||
38 | 2.13.3 | ||
39 | |||
diff --git a/meta-oe/recipes-support/ssiapi/ssiapi_1.0.1.bb b/meta-oe/recipes-support/ssiapi/ssiapi_1.0.1.bb index 339637087..5eb4696b5 100644 --- a/meta-oe/recipes-support/ssiapi/ssiapi_1.0.1.bb +++ b/meta-oe/recipes-support/ssiapi/ssiapi_1.0.1.bb | |||
@@ -18,7 +18,8 @@ SRC_URI = "http://sourceforge.net/projects/irstessi/files/${BPN}.${PV}.tgz \ | |||
18 | file://0005-engine-Define-SENTINEL.patch \ | 18 | file://0005-engine-Define-SENTINEL.patch \ |
19 | file://0006-tools-Add-missing-includes-and-use-realpath-instead-.patch \ | 19 | file://0006-tools-Add-missing-includes-and-use-realpath-instead-.patch \ |
20 | file://configure-cflags.patch \ | 20 | file://configure-cflags.patch \ |
21 | " | 21 | file://0001-ssieventmonitor-ordered-comparison-between-pointers-.patch \ |
22 | " | ||
22 | SRC_URI[md5sum] = "02f16d7cbd30d28034093212906591f5" | 23 | SRC_URI[md5sum] = "02f16d7cbd30d28034093212906591f5" |
23 | SRC_URI[sha256sum] = "e10d283b0f211afb8ebd0bde87c097769613d30a052cdf164753e35e803264c7" | 24 | SRC_URI[sha256sum] = "e10d283b0f211afb8ebd0bde87c097769613d30a052cdf164753e35e803264c7" |
24 | 25 | ||