supermin/0005-init-Ignore-warnings-about-unchecked-return-values.patch

30 lines
853 B
Diff
Raw Normal View History

From c89146030ffd0ffdf921917111b88d3b32c5b2b8 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Fri, 2 Sep 2022 12:01:36 +0100
Subject: [PATCH 05/12] init: Ignore warnings about unchecked return values
---
init/init.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/init/init.c b/init/init.c
index 60e099e..bc28c69 100644
--- a/init/init.c
+++ b/init/init.c
@@ -49,6 +49,12 @@
/* else it's in sys/types.h, included above */
#endif
+/* We make several calls to asprintf, chdir, fgets and ignore the
+ * result. Since this is a minimal init system there's nothing we can
+ * do if these calls fail.
+ */
+#pragma GCC diagnostic ignored "-Wunused-result"
+
/* Maximum time to wait for the root device to appear (seconds).
*
* On slow machines with lots of disks (Koji running the 255 disk test
--
2.37.3