Skip to contentSkip to conversation

kmod: configure.ac: In _Noreturn check, include <stdlib.h> for exit

PATCH Applied Florian Weimer 2 participants 2 messages Dec 17, 2022 – Dec 26, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kmod: configure.ac: In _Noreturn check, include <stdlib.h> for exit

Otherwise, an implicit functiona declaration is used, causing a C99 compatibility issue.

---
 configure.ac | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
configure.ac +2 -1
index 6989e93..12e0518 100644
@@ -68,7 +68,8 @@ AC_COMPILE_IFELSE(
 
 AC_MSG_CHECKING([whether _Noreturn is supported])
 AC_COMPILE_IFELSE(
-	[AC_LANG_SOURCE([[_Noreturn int foo(void) { exit(0); }]])],
+	[AC_LANG_SOURCE([[#include <stdlib.h>
+	_Noreturn int foo(void) { exit(0); }]])],
         [AC_DEFINE([HAVE_NORETURN], [1], [Define if _Noreturn is available])
 	 AC_MSG_RESULT([yes])],
 	[AC_MSG_RESULT([no])])

base-commit: 6c5f2f13689e6a4668f87171752d7818bed4b602

#1 lore raw
Quoted 4 lines · Florian Weimer

Otherwise, an implicit functiona declaration is used, causing a C99 compatibility issue.

applied, thanks

Lucas De Marchi

Quoted 22 lines

---
configure.ac | 3 ++-

1 file changed, 2 insertions(+), 1 deletion(-)
configure.ac +0 -0
index 6989e93..12e0518 100644
@@ -68,7 +68,8 @@ AC_COMPILE_IFELSE(
 
 AC_MSG_CHECKING([whether _Noreturn is supported])

AC_COMPILE_IFELSE(

configure.ac +2 -1
-	[AC_LANG_SOURCE([[_Noreturn int foo(void) { exit(0); }]])],
+	[AC_LANG_SOURCE([[#include <stdlib.h>
+	_Noreturn int foo(void) { exit(0); }]])],
        [AC_DEFINE([HAVE_NORETURN], [1], [Define if _Noreturn is available])
	 AC_MSG_RESULT([yes])],
	[AC_MSG_RESULT([no])])

base-commit: 6c5f2f13689e6a4668f87171752d7818bed4b602