Skip to content

Commit ba82f52

Browse files
brglmasahir0y
authored andcommitted
kconfig: fix an "implicit declaration of function" warning
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.o scripts/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. Signed-off-by: Bartosz Golaszewski <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
1 parent a960968 commit ba82f52

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

scripts/kconfig/gconf.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#include <stdio.h>
2020
#include <string.h>
21+
#include <strings.h>
2122
#include <unistd.h>
2223
#include <time.h>
2324

scripts/kconfig/mconf.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <stdarg.h>
1616
#include <stdlib.h>
1717
#include <string.h>
18+
#include <strings.h>
1819
#include <signal.h>
1920
#include <unistd.h>
2021

scripts/kconfig/nconf.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#define _GNU_SOURCE
99
#endif
1010
#include <string.h>
11+
#include <strings.h>
1112
#include <stdlib.h>
1213

1314
#include "lkc.h"

0 commit comments

Comments
 (0)