]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix test failure due to -Wnonnull warnings
authorJonathan Wakely <jwakely@redhat.com>
Thu, 12 Mar 2020 17:39:05 +0000 (17:39 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 12 Mar 2020 17:39:05 +0000 (17:39 +0000)
This test fails in the Fedora RPM build (but not elsewhere, for unknown
reasons). The warning is correct, we're passing a null pointer.

Backport from mainline
2020-03-12  Jonathan Wakely  <jwakely@redhat.com>

* testsuite/tr1/8_c_compatibility/cstdlib/functions.cc: Do not pass
a null pointer to functions with nonnull(1) attribute.

libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/tr1/8_c_compatibility/cstdlib/functions.cc

index 7608f7028f61f778863326d24682b45e772971d5..fd80d5d091ff1e33e23deb56e06cea9dfe8e4789 100644 (file)
@@ -1,5 +1,11 @@
 2020-03-12  Jonathan Wakely  <jwakely@redhat.com>
 
+       Backport from mainline
+       2020-03-12  Jonathan Wakely  <jwakely@redhat.com>
+
+       * testsuite/tr1/8_c_compatibility/cstdlib/functions.cc: Do not pass
+       a null pointer to functions with nonnull(1) attribute.
+
        Backport from mainline
        2020-02-28  Jonathan Wakely  <jwakely@redhat.com>
 
index e1feef9958236a76d6925a0c0124d80a4c31b265..0f00a94da423e2b47bb5bb8191e146431ece32cd 100644 (file)
@@ -30,7 +30,7 @@ void test01()
 #if _GLIBCXX_USE_C99_STDLIB
 
   long long i = 0;
-  const char* s = 0;
+  const char* s = "";
   char** endptr = 0;
   int base = 0;