diff mbox series

[v1,5/5] Fix build warnings.

Message ID 452424632f165f07e25aaf549099d1d2e15d4eb4.1664412495.git.geoff@infradead.org
State New
Headers show
Series *** SUBJECT HERE *** | expand

Commit Message

Geoff Levand Sept. 29, 2022, 12:52 a.m. UTC
Fixes build warnings like these:

  warning: implicit declaration of function ‘memmem’
  warning: assignment to ‘char *’ from ‘int’ makes pointer from integer without a cast

Signed-off-by: Geoff Levand <geoff@infradead.org>
---
 discover/paths.c       | 2 ++
 discover/pxe-parser.c  | 4 +++-
 ui/ncurses/nc-plugin.c | 1 +
 3 files changed, 6 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/discover/paths.c b/discover/paths.c
index 3c43bf6..19674bb 100644
--- a/discover/paths.c
+++ b/discover/paths.c
@@ -2,6 +2,8 @@ 
 #include "config.h"
 #endif
 
+#define _GNU_SOURCE
+
 #include <assert.h>
 #include <netdb.h>
 #include <string.h>
diff --git a/discover/pxe-parser.c b/discover/pxe-parser.c
index 035794c..2b10771 100644
--- a/discover/pxe-parser.c
+++ b/discover/pxe-parser.c
@@ -1,7 +1,9 @@ 
-
 #if defined(HAVE_CONFIG_H)
 #include "config.h"
 #endif
+
+#define _GNU_SOURCE
+
 #include <stdlib.h>
 #include <string.h>
 
diff --git a/ui/ncurses/nc-plugin.c b/ui/ncurses/nc-plugin.c
index f897cc8..1152bf3 100644
--- a/ui/ncurses/nc-plugin.c
+++ b/ui/ncurses/nc-plugin.c
@@ -20,6 +20,7 @@ 
 #endif
 
 #include <errno.h>
+#include <libgen.h>
 #include <stdlib.h>
 #include <string.h>