Patrick Williams | 44b3caf | 2024-04-12 16:51:14 -0500 | [diff] [blame^] | 1 | From e4125223631f0d555fc327da6d8705bcc8ee5ba5 Mon Sep 17 00:00:00 2001 |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 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> |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 13 | --- |
| 14 | src/man.c | 4 ++-- |
| 15 | 1 file changed, 2 insertions(+), 2 deletions(-) |
| 16 | |
| 17 | diff --git a/src/man.c b/src/man.c |
Patrick Williams | 44b3caf | 2024-04-12 16:51:14 -0500 | [diff] [blame^] | 18 | index 195d35d..6870989 100644 |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 19 | --- a/src/man.c |
| 20 | +++ b/src/man.c |
Patrick Williams | 44b3caf | 2024-04-12 16:51:14 -0500 | [diff] [blame^] | 21 | @@ -379,7 +379,7 @@ static void init_html_pager (void) |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 22 | static error_t parse_opt (int key, char *arg, struct argp_state *state) |
| 23 | { |
| 24 | static bool apropos, whatis; /* retain values between calls */ |
| 25 | - |
| 26 | + char *s; |
| 27 | /* Please keep these keys in the same order as in options above. */ |
| 28 | switch (key) { |
| 29 | case 'C': |
Patrick Williams | 44b3caf | 2024-04-12 16:51:14 -0500 | [diff] [blame^] | 30 | @@ -411,7 +411,7 @@ static error_t parse_opt (int key, char *arg, struct argp_state *state) |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 31 | case OPT_WARNINGS: |
| 32 | #ifdef NROFF_WARNINGS |
| 33 | { |
| 34 | - char *s = xstrdup |
| 35 | + s = xstrdup |
| 36 | (arg ? arg : default_roff_warnings); |
| 37 | const char *warning; |
| 38 | |