[oe-commits] [meta-openembedded] 34/73: ssiapi: Fix build errors found with clang

git at git.openembedded.org git at git.openembedded.org
Tue Aug 8 18:42:13 UTC 2017


This is an automated email from the git hooks/post-receive script.

martin_jansa pushed a commit to branch master-next
in repository meta-openembedded.

commit 566fd652ddffbc6fc339c7ca6e39105c9f359c29
Author: Khem Raj <raj.khem at gmail.com>
AuthorDate: Wed Jul 26 11:58:14 2017 -0700

    ssiapi: Fix build errors found with clang
    
    Signed-off-by: Khem Raj <raj.khem at gmail.com>
    Signed-off-by: Martin Jansa <Martin.Jansa at gmail.com>
---
 ...itor-ordered-comparison-between-pointers-.patch | 39 ++++++++++++++++++++++
 meta-oe/recipes-support/ssiapi/ssiapi_1.0.1.bb     |  3 +-
 2 files changed, 41 insertions(+), 1 deletion(-)

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 0000000..27df9b5
--- /dev/null
+++ b/meta-oe/recipes-support/ssiapi/ssiapi/0001-ssieventmonitor-ordered-comparison-between-pointers-.patch
@@ -0,0 +1,39 @@
+From ea9ecf4bf305f9509d5822b3823658a40162f43c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem at gmail.com>
+Date: Tue, 25 Jul 2017 19:08:21 -0700
+Subject: [PATCH] ssieventmonitor: ordered comparison between pointers and
+ zero, actually with NULL
+
+Comparing which is large or small between a pointer and NULL
+however, looks completely illogical. Ordered comparison of
+two valid pointers is legit, but no pointer will be smaller
+than NULL , so comparing if a pointer is larger than NULL
+simply means if the pointer is not NULL.
+
+Fixes errors found with clang e.g.
+
+| ssieventmonitor.cpp:339:53: error: ordered comparison between pointer and zero ('char *' and 'int')
+|                 if (fgets(nextline, sizeof(nextline) - 1, mdstat) < 0) {
+|                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
+
+Signed-off-by: Khem Raj <raj.khem at gmail.com>
+---
+ tools/ssieventmonitor.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tools/ssieventmonitor.cpp b/tools/ssieventmonitor.cpp
+index f04b8f0..7a00122 100644
+--- a/tools/ssieventmonitor.cpp
++++ b/tools/ssieventmonitor.cpp
+@@ -336,7 +336,7 @@ static int _read_mdstat(int fd)
+ 	if (!strncmp(line, "md", 2)) {
+ 	    if (strstr(line, INACTIVE_STR)) { /* possibly container */
+ 		char nextline[1024];
+-		if (fgets(nextline, sizeof(nextline) - 1, mdstat) < 0) {
++		if (fgets(nextline, sizeof(nextline) - 1, mdstat) != (char *) NULL) {
+ 		    fclose(mdstat);
+ 		    return 1;
+ 		}
+-- 
+2.13.3
+
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 3396370..5eb4696 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 \
            file://0005-engine-Define-SENTINEL.patch \
            file://0006-tools-Add-missing-includes-and-use-realpath-instead-.patch \
            file://configure-cflags.patch \
-"
+           file://0001-ssieventmonitor-ordered-comparison-between-pointers-.patch \
+           "
 SRC_URI[md5sum] = "02f16d7cbd30d28034093212906591f5"
 SRC_URI[sha256sum] = "e10d283b0f211afb8ebd0bde87c097769613d30a052cdf164753e35e803264c7"
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list