libstdc++: Fix test failure due to -Wnonnull warnings
authorJonathan Wakely <jwakely@redhat.com>
Thu, 12 Mar 2020 11:03:04 +0000 (11:03 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 12 Mar 2020 11:03:04 +0000 (11:03 +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.

* 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 4ff4a0eecc9b4b0f84698ee3eaf264b61b5cc9ef..5cf329fdda7f265952def7748ad425ee62d65308 100644 (file)
@@ -1,3 +1,8 @@
+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.
+
 2020-03-11  Patrick Palka  <ppalka@redhat.com>
 
        * include/std/ranges (split_view::_OuterIter::_OuterIter): Typo fix,
index 89c078ffe6f6354671973cfbe951d5d3660e461e..227a7580bcf0c9c2bb2e43a7b058c3df60c38d1c 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;