kconfig: fix an "implicit declaration of function" warning
PATCH 1/1 kconfig: fix an "implicit declaration of function" warning
From: Bartosz Golaszewski <[email protected]>
strncasecmp() & strcasecmp() functions are declared in strings.h, not string.h. On most environments the former is implicitly included by the latter but on some setups, building menuconfig results in the following warning:
HOSTCC scripts/kconfig/mconf.oscripts/kconfig/mconf.c: In function ‘search_conf’:scripts/kconfig/mconf.c:423:6: warning: implicit declaration of function ‘strncasecmp’ [-Wimplicit-function-declaration]
if (strncasecmp(dialog_input_result, CONFIG_, strlen(CONFIG_)) == 0)
^~~~~~~~~~~
scripts/kconfig/mconf.c: In function ‘main’:
scripts/kconfig/mconf.c:1021:8: warning: implicit declaration of function ‘strcasecmp’ [-Wimplicit-function-declaration]
if (!strcasecmp(mode, "single_menu"))
^~~~~~~~~~Fix it by explicitly including strings.h.
--- scripts/kconfig/mconf.c | 1 + 1 file changed, 1 insertion(+)
scripts/kconfig/mconf.c +1 -0
@@ -15,6 +15,7 @@#include <stdarg.h> #include <stdlib.h> #include <string.h> +#include <strings.h> #include <signal.h> #include <unistd.h>
Signature · 1 line
2.23.0
Quoted 18 lines · Bartosz Golaszewski
From: Bartosz Golaszewski <[email protected]>
strncasecmp()&strcasecmp()functions are declared instrings.h, notstring.h. On most environments the former is implicitly included by the latter but on some setups, building menuconfig results in the following warning:HOSTCC
scripts/kconfig/mconf.oscripts/kconfig/mconf.c: In function ‘search_conf’:scripts/kconfig/mconf.c:423:6: warning: implicit declaration of function ‘strncasecmp’ [-Wimplicit-function-declaration]
if (strncasecmp(dialog_input_result, CONFIG_, strlen(CONFIG_))== 0)^~~~~~~~~~~ scripts/kconfig/mconf.c: In function ‘main’: scripts/kconfig/mconf.c:1021:8: warning: implicit declaration of function ‘strcasecmp’ [-Wimplicit-function-declaration] if (!strcasecmp(mode, "single_menu")) ^~~~~~~~~~
Quoted 3 lines
Fix it by explicitly including
strings.h.Signed-off-by Bartosz Golaszewski <[email protected]>
Thanks.
I see strncasecmp() inscripts/kconfig/nconf.c too.
Could you fix both in a single patch?
You can try it with "make nconfig".
Quoted 19 lines
--- scripts/kconfig/mconf.c | 1 + 1 file changed, 1 insertion(+)scripts/kconfig/mconf.c +1
-1@@ -15,6 +15,7 @@#include <stdarg.h> #include <stdlib.h> #include <string.h> +#include <strings.h> #include <signal.h> #include <unistd.h> --2.23.0
Signature · 2 lines
Best Regards Masahiro Yamada
czw., 9 sty 2020 o 16:59 Masahiro Yamada <[email protected]> napisał(a):
Quoted 24 lines · Bartosz Golaszewski
Quoted 18 lines
From: Bartosz Golaszewski <[email protected]>
strncasecmp()&strcasecmp()functions are declared instrings.h, notstring.h. On most environments the former is implicitly included by the latter but on some setups, building menuconfig results in the following warning:HOSTCC
scripts/kconfig/mconf.oscripts/kconfig/mconf.c: In function ‘search_conf’:scripts/kconfig/mconf.c:423:6: warning: implicit declaration of function ‘strncasecmp’ [-Wimplicit-function-declaration]
if (strncasecmp(dialog_input_result, CONFIG_, strlen(CONFIG_))== 0)^~~~~~~~~~~ scripts/kconfig/mconf.c: In function ‘main’: scripts/kconfig/mconf.c:1021:8: warning: implicit declaration of function ‘strcasecmp’ [-Wimplicit-function-declaration] if (!strcasecmp(mode, "single_menu")) ^~~~~~~~~~Quoted 3 lines
Fix it by explicitly including
strings.h.Signed-off-by Bartosz Golaszewski <[email protected]>
Quoted 8 lines
Thanks.
I see
strncasecmp()inscripts/kconfig/nconf.ctoo.Could you fix both in a single patch?
You can try it with "make nconfig".
Sure. It seems gconf needs the same change too.
Bart