[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 4/7] Don’t assume compilers don’t output to stderr

From: Paul Eggert
Subject: [PATCH 4/7] Don’t assume compilers don’t output to stderr
Date: Thu, 26 Jan 2023 14:17:35 -0800

Redo the computation of ac_cv_have_no_reorder and
ac_cv_have_returns_nonnull so that we don’t assume
their complicated compilations do not output to stdout.
Problem found on gcc401, which has CLFS for LoongArch64 7.2
with GCC 13.0.0 20221018 (experimental).
 configure.ac | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/configure.ac b/configure.ac
index 4e314f1..b4db5b8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1194,16 +1194,15 @@ fi
 # Check for specific attributes not supported by older versions of GCC;
 # and possibly by other compilers.  Notice that we have to temporarily
-# change CFLAGS (in a subshell, so as not to affect the rest of this
-# script) to force -Werror.  If -Werror is not supported than the tests
+# change CFLAGS to force -Werror.  If -Werror is not supported than the tests
 # will all fail, which is the correct conservative behavior.
-# Out of the subshell, define the shell variable ac_cv_have_ATTRIBUTE ,
-# in order for the test result to be visible in the following.
 # FIXME: I should factor the following with M4.
 # Check for attribute no_reorder .
-ac_cv_have_no_reorder=$(CFLAGS="$CFLAGS -Werror"; export CFLAGS
 AC_CACHE_CHECK([for the no_reorder attribute],
@@ -1221,11 +1220,9 @@ AC_CACHE_CHECK([for the no_reorder attribute],
 if test "x$ac_cv_have_no_reorder" = "xyes"; then
             [Define if the no_reorder attribute works])
-echo "$ac_cv_have_no_reorder")
 # Check for attribute returns_nonnull .
-ac_cv_have_returns_nonnull=$(CFLAGS="$CFLAGS -Werror"; export CFLAGS
 AC_CACHE_CHECK([for the returns_nonnull attribute],
@@ -1244,7 +1241,9 @@ if test "x$ac_cv_have_returns_nonnull" = "xyes"; then
             [Define if the returns_nonnull attribute works])
-echo "$ac_cv_have_returns_nonnull")
+# End of -Werror section.
 # Many people like to compile with -Werror.  This is a way of redefining
 # attributes not supported by the compiler so that they expand to nothing.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]