From 796eba65e7e1cbceac32c28ef83862c19d953cf0 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Sun, 15 Sep 2024 15:52:37 +0200 Subject: [PATCH] Autotools: Fix CS in undefined sanitizer check (#15892) To prevent possible unused warnings turning into false errors. --- configure.ac | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 198f04afd9e..6b61df11ab4 100644 --- a/configure.ac +++ b/configure.ac @@ -1526,11 +1526,12 @@ AS_VAR_IF([PHP_UNDEFINED_SANITIZER], [yes], AC_CACHE_CHECK([whether to add -fno-sanitize=function], [php_cv_ubsan_no_function], [AC_RUN_IFELSE([AC_LANG_SOURCE([ -void foo(char *string) {} -int main(void) { - void (*f)(void *) = (void (*)(void *))foo; - f("foo"); -} + void foo(char *string) { (void)string; } + int main(void) { + void (*f)(void *) = (void (*)(void *))foo; + f("foo"); + return 0; + } ])], [php_cv_ubsan_no_function=no], [php_cv_ubsan_no_function=yes],