]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix -Wnonnull warnings during configure
authorJonathan Wakely <jwakely@redhat.com>
Fri, 12 May 2023 11:17:08 +0000 (12:17 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 12 May 2023 16:47:17 +0000 (17:47 +0100)
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
libstdc++-v3/configure

index 89e7f5f5f45e6ef95e8dfbee31dca3dfe7c48e55..42a8e7a775e1f83a8e1e01b13cecb7fe15dd397d 100644 (file)
@@ -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);
index 99f4927aa8c932a2b92b93f8ab8be5fcaa33b416..d4286b67a73662dda55b3624cbf794a0aeebe741 100755 (executable)
@@ -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);