summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/man-db/files/0001-man-Move-local-variable-declaration-to-function-scop.patch
blob: dc6966629c33c2a284f96913613eb09c5e50ea26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From 126dfefb5fddf411ad0a1316209e9c1b47abfcd2 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 f16fae8..333df03 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':
@@ -384,7 +384,7 @@ static error_t parse_opt (int key, char *arg, struct argp_state *state)
 		case OPT_WARNINGS:
 #ifdef NROFF_WARNINGS
 			{
-				char *s = xstrdup
+				s = xstrdup
 					(arg ? arg : default_roff_warnings);
 				const char *warning;