]> code.ossystems Code Review - openembedded-core.git/commitdiff
man-db: Fix build with clang
authorKhem Raj <raj.khem@gmail.com>
Thu, 10 Feb 2022 01:34:44 +0000 (17:34 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 12 Feb 2022 17:02:56 +0000 (17:02 +0000)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-extended/man-db/files/0001-man-Move-local-variable-declaration-to-function-scop.patch [new file with mode: 0644]
meta/recipes-extended/man-db/man-db_2.10.0.bb

diff --git a/meta/recipes-extended/man-db/files/0001-man-Move-local-variable-declaration-to-function-scop.patch b/meta/recipes-extended/man-db/files/0001-man-Move-local-variable-declaration-to-function-scop.patch
new file mode 100644 (file)
index 0000000..820b17b
--- /dev/null
@@ -0,0 +1,41 @@
+From 4b5e00ad020ec327cbc934528d02aa8c4fe3910b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 9 Feb 2022 17:30:16 -0800
+Subject: [PATCH] man: Move local variable declaration to function scope
+
+There is a clang bug [1] unearthed here, so help clang by re-arranging
+code without changing the logic, until its fixed in clang
+
+[1] https://github.com/llvm/llvm-project/issues/53692
+
+Upstream-Status: Inappropriate [Inappropriate: Clang bug]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/man.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/man.c b/src/man.c
+index c91abf1..3240eea 100644
+--- a/src/man.c
++++ b/src/man.c
+@@ -352,7 +352,7 @@ static void init_html_pager (void)
+ static error_t parse_opt (int key, char *arg, struct argp_state *state)
+ {
+       static bool apropos, whatis; /* retain values between calls */
+-
++      char *s;
+       /* Please keep these keys in the same order as in options above. */
+       switch (key) {
+               case 'C':
+@@ -383,7 +383,7 @@ static error_t parse_opt (int key, char *arg, struct argp_state *state)
+               case OPT_WARNINGS:
+ #ifdef NROFF_WARNINGS
+-                      char *s = xstrdup (arg ? arg : default_roff_warnings);
++                      s = xstrdup (arg ? arg : default_roff_warnings);
+                       const char *warning;
+                       for (warning = strtok (s, ","); warning;
+-- 
+2.35.1
+
index 6a8ac2e3e3445218c9be9afd3030dc1160a5fc9f..a604930198e3ad21c8e4e934343e841f554cd044 100644 (file)
@@ -7,6 +7,7 @@ LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c \
 
 SRC_URI = "${SAVANNAH_NONGNU_MIRROR}/man-db/man-db-${PV}.tar.xz \
            file://99_mandb \
+           file://0001-man-Move-local-variable-declaration-to-function-scop.patch \
            file://man_db.conf-avoid-multilib-install-file-conflict.patch"
 SRC_URI[sha256sum] = "0a8629022f7117dc7fc6473c6fdb14913b24b106059bb056abee87dbd6070c79"