From 69aa78133144fe7276dd4fe7f2eb7ff64f0a8337 Mon Sep 17 00:00:00 2001 From: Sam James Date: Fri, 4 Nov 2022 01:53:32 +0000 Subject: configure.ac: fix -Wimplicit-function-declaration in HAVE___FUNCTION__ test (Clang 16) Clang 16 will make -Wimplicit-function-declaration errors by default. ``` error: call to undeclared library function 'printf' with type 'int (const char *, ...)'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration] error: call to undeclared library function 'printf' with type 'int (const char *, ...)'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration] ``` For more information, see LWN.net [0] or LLVM's Discourse [1], gentoo-dev@ [2], or the (new) c-std-porting mailing list [3]. [0] https://lwn.net/Articles/913505/ [1] https://discourse.llvm.org/t/configure-script-breakage-with-the-new-werror-implicit-function-declaration/65213 [2] https://archives.gentoo.org/gentoo-dev/message/dd9f2d3082b8b6f8dfbccb0639e6e240 [3] hosted at lists.linux.dev. Signed-off-by: Sam James --- configure.ac | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index fae94798..84fc6bbc 100644 --- a/configure.ac +++ b/configure.ac @@ -335,7 +335,8 @@ AC_C_BIGENDIAN AC_C_INLINE AC_MSG_CHECKING(whether __FUNCTION__ is available) -AC_COMPILE_IFELSE([AC_LANG_SOURCE([int main() { printf(__FUNCTION__); }])], +AC_COMPILE_IFELSE([AC_LANG_SOURCE([#include +int main() { printf(__FUNCTION__); }])], [AC_DEFINE([HAVE___FUNCTION__], [1], [Is __FUNCTION__ available]) AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)]) -- cgit v1.2.1