public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] libstdc++: Fix -Wnonnull warnings during configure
@ 2023-05-12 16:49 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2023-05-12 16:49 UTC (permalink / raw)
  To: libstdc++, gcc-patches

Tested powerpc64le-linux. Pushed to trunk.

-- >8 --

We should not test for nan by passing it a null pointer, as this can
trigger -Wnonnull warnings.

Also fix an outdated comment about the default -std mode.

libstdc++-v3/ChangeLog:

	* acinclude.m4 (GLIBCXX_CHECK_C99_TR1): Use a non-null pointer
	to check for nan, nanf, and nanl.
	* configure: Regenerate.
---
 libstdc++-v3/acinclude.m4 | 8 ++++----
 libstdc++-v3/configure    | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index 89e7f5f5f45..42a8e7a775e 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -1620,7 +1620,7 @@ AC_DEFUN([GLIBCXX_CHECK_C99_TR1], [
   AC_LANG_SAVE
   AC_LANG_CPLUSPLUS
 
-  # Use -std=c++98 because the default (-std=gnu++98) leaves __STRICT_ANSI__
+  # Use -std=c++98 because -std=gnu++98 leaves __STRICT_ANSI__
   # undefined and fake C99 facilities may be spuriously enabled.
   ac_save_CXXFLAGS="$CXXFLAGS"
   CXXFLAGS="$CXXFLAGS -std=c++98"
@@ -1885,9 +1885,9 @@ AC_DEFUN([GLIBCXX_CHECK_C99_TR1], [
 		  lround(0.0);
 		  lroundf(0.0f);
 		  lroundl(0.0l);
-		  nan(0);
-		  nanf(0);
-		  nanl(0);
+		  nan("");
+		  nanf("");
+		  nanl("");
 		  nearbyint(0.0);
 		  nearbyintf(0.0f);
 		  nearbyintl(0.0l);
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 99f4927aa8c..d4286b67a73 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -19731,7 +19731,7 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex
 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
 
-  # Use -std=c++98 because the default (-std=gnu++98) leaves __STRICT_ANSI__
+  # Use -std=c++98 because -std=gnu++98 leaves __STRICT_ANSI__
   # undefined and fake C99 facilities may be spuriously enabled.
   ac_save_CXXFLAGS="$CXXFLAGS"
   CXXFLAGS="$CXXFLAGS -std=c++98"
@@ -20106,9 +20106,9 @@ typedef double_t  my_double_t;
 		  lround(0.0);
 		  lroundf(0.0f);
 		  lroundl(0.0l);
-		  nan(0);
-		  nanf(0);
-		  nanl(0);
+		  nan("");
+		  nanf("");
+		  nanl("");
 		  nearbyint(0.0);
 		  nearbyintf(0.0f);
 		  nearbyintl(0.0l);
-- 
2.40.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-05-12 16:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-12 16:49 [committed] libstdc++: Fix -Wnonnull warnings during configure Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).