Skip to contentSkip to conversation

mmc-utils: Fix build with clang

PATCH In review Khem Raj 2 participants 5 messages May 10, 2019 – May 14, 2019

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/2 mmc-utils: Fix build with clang

clang has more warnings to report, lets fix them

---
 ...tra-braces-when-initializing-subobje.patch | 32 +++++++++++++++++++
 meta/recipes-devtools/mmc/mmc-utils_git.bb    |  1 +
 2 files changed, 33 insertions(+)
 create mode 100644 meta/recipes-devtools/mmc/mmc-utils/0001-mmc_cmd.c-Use-extra-braces-when-initializing-subobje.patch
meta/recipes-devtools/mmc/mmc-utils/0001-mmc_cmd.c-Use-extra-braces-when-initializing-subobje.patch new file +32 -0
new file mode 100644
index 0000000000..12707357b2
@@ -0,0 +1,32 @@
+From 04fbe6ddb5f1e02efbcae3cdf5beb16757a98948 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Fri, 10 May 2019 12:58:01 -0700
+Subject: [PATCH] mmc_cmd.c: Use extra braces when initializing subobjects
+
+clang warns with -Werror,-Wmissing-braces, as following error
+| mmc_cmds.c:1886:36: error: suggest braces around initialization of subobject [-Werror,-W
+missing-braces]
+|         struct rpmb_frame frame_status = {0};
+|                                           ^
+|                                           {}
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ mmc_cmds.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/mmc_cmds.c b/mmc_cmds.c
+index 19a9da1..838e8c3 100644
+--- a/mmc_cmds.c
++++ b/mmc_cmds.c
+@@ -1883,7 +1883,7 @@ static int do_rpmb_op(int fd,
+ 	u_int16_t rpmb_type;
+ 	struct mmc_ioc_multi_cmd *mioc;
+ 	struct mmc_ioc_cmd *ioc;
+-	struct rpmb_frame frame_status = {0};
++	struct rpmb_frame frame_status = {{0}};
+ 
+ 	if (!frame_in || !frame_out || !out_cnt)
+ 		return -EINVAL;
meta/recipes-devtools/mmc/mmc-utils_git.bb +1 -0
index f3a7234670..0c401c86fa 100644
@@ -9,6 +9,7 @@ SRCREV = "aef913e31b659462fe6b9320d241676cba97f67b"
 PV = "0.1+git${SRCPV}"
 
 SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc-utils.git;branch=${SRCBRANCH} \
+           file://0001-mmc_cmd.c-Use-extra-braces-when-initializing-subobje.patch \
            "
 UPSTREAM_CHECK_COMMITS = "1"
 
Signature · 1 line
2.21.0
author
#1 lore raw

PATCH 2/2 epiphany: Fix build with clang

This patch is upstreamable, issue is not caught by gcc

---
 .../epiphany/epiphany_3.32.1.2.bb             |  1 +
 ...itialization-of-variable-with-__attr.patch | 54 +++++++++++++++++++
 2 files changed, 55 insertions(+)
 create mode 100644 meta/recipes-gnome/epiphany/files/0001-Do-not-bypass-initialization-of-variable-with-__attr.patch
meta/recipes-gnome/epiphany/epiphany_3.32.1.2.bb +1 -0
index ba2e851bb6..fc26a878d6 100644
@@ -12,6 +12,7 @@ REQUIRED_DISTRO_FEATURES = "x11 opengl"
 
 SRC_URI = "${GNOME_MIRROR}/${GNOMEBN}/${@gnome_verdir("${PV}")}/${GNOMEBN}-${PV}.tar.${GNOME_COMPRESS_TYPE};name=archive \
            file://0002-help-meson.build-disable-the-use-of-yelp.patch \
+           file://0001-Do-not-bypass-initialization-of-variable-with-__attr.patch \
            "
 SRC_URI[archive.md5sum] = "93faec353e9f62519859e6164350fd5d"
 SRC_URI[archive.sha256sum] = "a8284fb9bbc8b7914a154a8eac1598c8b59ae421e0d685146fb48198427926be"
meta/recipes-gnome/epiphany/files/0001-Do-not-bypass-initialization-of-variable-with-__attr.patch new file +54 -0

54 lines not on this page · raw message

Signature · 1 line
2.21.0
#2 lore raw

Re: [PATCH 2/2] epiphany: Fix build with clang

Quoted 2 lines · Khem Raj

This patch is upstreamable, issue is not caught by gcc
...

Upstream already has a different fix for this:
https://gitlab.gnome.org/GNOME/epiphany/commit/a6a022c9c498ad5dcf7f2220644a7520df74ca31

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
author
#4 lore raw
In reply to Khem Raj

ping^1

Quoted 63 lines · Khem Raj

clang has more warnings to report, lets fix them

---
 ...tra-braces-when-initializing-subobje.patch | 32 +++++++++++++++++++
 meta/recipes-devtools/mmc/mmc-utils_git.bb    |  1 +
 2 files changed, 33 insertions(+)
 create mode 100644 meta/recipes-devtools/mmc/mmc-utils/0001-mmc_cmd.c-Use-extra-braces-when-initializing-subobje.patch
meta/recipes-devtools/mmc/mmc-utils/0001-mmc_cmd.c-Use-extra-braces-when-initializing-subobje.patch new file +32 -0
new file mode 100644
index 0000000000..12707357b2
@@ -0,0 +1,32 @@
+From 04fbe6ddb5f1e02efbcae3cdf5beb16757a98948 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Fri, 10 May 2019 12:58:01 -0700
+Subject: [PATCH] mmc_cmd.c: Use extra braces when initializing subobjects
+
+clang warns with -Werror,-Wmissing-braces, as following error
+| mmc_cmds.c:1886:36: error: suggest braces around initialization of subobject [-Werror,-W
+missing-braces]
+|         struct rpmb_frame frame_status = {0};
+|                                           ^
+|                                           {}
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ mmc_cmds.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/mmc_cmds.c b/mmc_cmds.c
+index 19a9da1..838e8c3 100644
+--- a/mmc_cmds.c
++++ b/mmc_cmds.c
+@@ -1883,7 +1883,7 @@ static int do_rpmb_op(int fd,
+       u_int16_t rpmb_type;
+       struct mmc_ioc_multi_cmd *mioc;
+       struct mmc_ioc_cmd *ioc;
+-      struct rpmb_frame frame_status = {0};
++      struct rpmb_frame frame_status = {{0}};
+
+       if (!frame_in || !frame_out || !out_cnt)
+               return -EINVAL;
meta/recipes-devtools/mmc/mmc-utils_git.bb +1 -1
index f3a7234670..0c401c86fa 100644
@@ -9,6 +9,7 @@ SRCREV = "aef913e31b659462fe6b9320d241676cba97f67b"
 PV = "0.1+git${SRCPV}"
 
 SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc-utils.git;branch=${SRCBRANCH} \
+           file://0001-mmc_cmd.c-Use-extra-braces-when-initializing-subobje.patch \
            "
 UPSTREAM_CHECK_COMMITS = "1"
 
--

2.21.0