kmod-configure-c99.patch 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. configure.ac: In _Noreturn check, include <stdlib.h> for exit
  2. Otherwise, an implicit functiona declaration is used, causing
  3. a C99 compatibility issue.
  4. Submitted upstream:
  5. <https://lore.kernel.org/linux-modules/877cyq6kh9.fsf@oldenburg.str.redhat.com/>
  6. diff --git a/configure b/configure
  7. index d053310a8b4a313a..ec1f12d02428f848 100755
  8. --- a/configure
  9. +++ b/configure
  10. @@ -14021,7 +14021,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
  11. printf %s "checking whether _Noreturn is supported... " >&6; }
  12. cat confdefs.h - <<_ACEOF >conftest.$ac_ext
  13. /* end confdefs.h. */
  14. -_Noreturn int foo(void) { exit(0); }
  15. +#include <stdlib.h>
  16. + _Noreturn int foo(void) { exit(0); }
  17. _ACEOF
  18. if ac_fn_c_try_compile "$LINENO"
  19. then :
  20. diff --git a/configure.ac b/configure.ac
  21. index 6989e9360da23721..12e0518533201ccf 100644
  22. --- a/configure.ac
  23. +++ b/configure.ac
  24. @@ -68,7 +68,8 @@ AC_COMPILE_IFELSE(
  25. AC_MSG_CHECKING([whether _Noreturn is supported])
  26. AC_COMPILE_IFELSE(
  27. - [AC_LANG_SOURCE([[_Noreturn int foo(void) { exit(0); }]])],
  28. + [AC_LANG_SOURCE([[#include <stdlib.h>
  29. + _Noreturn int foo(void) { exit(0); }]])],
  30. [AC_DEFINE([HAVE_NORETURN], [1], [Define if _Noreturn is available])
  31. AC_MSG_RESULT([yes])],
  32. [AC_MSG_RESULT([no])])