From b21f68d7511f18e3e2155a3dcb905ab3e3754c06 Mon Sep 17 00:00:00 2001 From: Huang Qi Date: Sun, 23 Apr 2023 10:13:19 +0800 Subject: [PATCH] tools/mksymtab: Fix a compilation warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix: ``` mksymtab.c: In function ‘main’: mksymtab.c:280:15: warning: the comparison will always evaluate as ‘true’ for the address of ‘g_parm’ will never be NULL [-Waddress] 280 | cond = (g_parm[COND_INDEX] && strlen(g_parm[COND_INDEX]) > 0); ``` Signed-off-by: Huang Qi --- tools/mksymtab.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/mksymtab.c b/tools/mksymtab.c index cc1690b363..0c54f4b275 100644 --- a/tools/mksymtab.c +++ b/tools/mksymtab.c @@ -277,7 +277,7 @@ int main(int argc, char **argv, char **envp) /* Output any conditional compilation */ - cond = (g_parm[COND_INDEX] && strlen(g_parm[COND_INDEX]) > 0); + cond = strlen(g_parm[COND_INDEX]) > 0; if (cond) { fprintf(outstream, "%s#if %s\n", nextterm, g_parm[COND_INDEX]);