[PATCH v2 5/5] Fix build warnings.
Geoff Levand
geoff at infradead.org
Sun Oct 9 03:42:32 AEDT 2022
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 at 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 --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>
--
2.34.1
More information about the Petitboot
mailing list