]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
kconfig: fix an "implicit declaration of function" warning
authorBartosz Golaszewski <bgolaszewski@baylibre.com>
Thu, 9 Jan 2020 16:16:36 +0000 (17:16 +0100)
committerMasahiro Yamada <masahiroy@kernel.org>
Thu, 9 Jan 2020 17:44:54 +0000 (02:44 +0900)
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 <bgolaszewski@baylibre.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/kconfig/gconf.c
scripts/kconfig/mconf.c
scripts/kconfig/nconf.c

index e36b342f1065b750b4e0f9105a015c66bb38d94f..5527482c30779b2e8ecf96a127fcce4e81d8ebeb 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <stdio.h>
 #include <string.h>
+#include <strings.h>
 #include <unistd.h>
 #include <time.h>
 
index 49c26ea9dd984db18f0709cb9a9eb95e47113dba..4063dbc1b9270279c391bc76d178bf76b745f3ca 100644 (file)
@@ -15,6 +15,7 @@
 #include <stdarg.h>
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h>
 #include <signal.h>
 #include <unistd.h>
 
index b7c1ef757178ad21b0b622a0139d716e72f6f332..daf1c1506ec4cc95fece4e87f0bd799b4b9c7bef 100644 (file)
@@ -8,6 +8,7 @@
 #define _GNU_SOURCE
 #endif
 #include <string.h>
+#include <strings.h>
 #include <stdlib.h>
 
 #include "lkc.h"