Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 1 | From 126dfefb5fddf411ad0a1316209e9c1b47abfcd2 Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Wed, 9 Feb 2022 17:30:16 -0800 |
| 4 | Subject: [PATCH] man: Move local variable declaration to function scope |
| 5 | |
| 6 | There is a clang bug [1] unearthed here, so help clang by re-arranging |
| 7 | code without changing the logic, until its fixed in clang |
| 8 | |
| 9 | [1] https://github.com/llvm/llvm-project/issues/53692 |
| 10 | |
| 11 | Upstream-Status: Inappropriate [Inappropriate: Clang bug] |
| 12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 13 | |
| 14 | --- |
| 15 | src/man.c | 4 ++-- |
| 16 | 1 file changed, 2 insertions(+), 2 deletions(-) |
| 17 | |
| 18 | diff --git a/src/man.c b/src/man.c |
| 19 | index f16fae8..333df03 100644 |
| 20 | --- a/src/man.c |
| 21 | +++ b/src/man.c |
| 22 | @@ -352,7 +352,7 @@ static void init_html_pager (void) |
| 23 | static error_t parse_opt (int key, char *arg, struct argp_state *state) |
| 24 | { |
| 25 | static bool apropos, whatis; /* retain values between calls */ |
| 26 | - |
| 27 | + char *s; |
| 28 | /* Please keep these keys in the same order as in options above. */ |
| 29 | switch (key) { |
| 30 | case 'C': |
| 31 | @@ -384,7 +384,7 @@ static error_t parse_opt (int key, char *arg, struct argp_state *state) |
| 32 | case OPT_WARNINGS: |
| 33 | #ifdef NROFF_WARNINGS |
| 34 | { |
| 35 | - char *s = xstrdup |
| 36 | + s = xstrdup |
| 37 | (arg ? arg : default_roff_warnings); |
| 38 | const char *warning; |
| 39 | |