From b98a05263614e626dabf9c68b1cf565bf9d29de8 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 9 Feb 2022 17:34:44 -0800 Subject: man-db: Fix build with clang (From OE-Core rev: f3e14090a3cfe168eb207667b553a861aa7de364) Signed-off-by: Khem Raj Signed-off-by: Richard Purdie --- ...cal-variable-declaration-to-function-scop.patch | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 meta/recipes-extended/man-db/files/0001-man-Move-local-variable-declaration-to-function-scop.patch (limited to 'meta/recipes-extended/man-db/files') 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 index 0000000000..820b17b5de --- /dev/null +++ b/meta/recipes-extended/man-db/files/0001-man-Move-local-variable-declaration-to-function-scop.patch @@ -0,0 +1,41 @@ +From 4b5e00ad020ec327cbc934528d02aa8c4fe3910b Mon Sep 17 00:00:00 2001 +From: Khem Raj +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 +--- + 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 + -- cgit v1.2.3-54-g00ecf