]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix testsuite with -Wformat
authorGwenole Beauchesne <gb.devel@gmail.com>
Wed, 6 Dec 2023 14:34:44 +0000 (15:34 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Sat, 6 Jan 2024 15:11:33 +0000 (15:11 +0000)
Fix testsuite when compiling with -Wformat. Use nonnull arguments so
that -Wformat does not cause extraneous output to be reported as an
error.

FAIL: tr1/8_c_compatibility/cinttypes/functions.cc (test for excess errors)

libstdc++-v3/ChangeLog:

* testsuite/tr1/8_c_compatibility/cinttypes/functions.cc: Use
nonnull arguments to strtoimax() and wcstoimax() functions.

Signed-off-by: Gwenole Beauchesne <gb.devel@gmail.com>
libstdc++-v3/testsuite/tr1/8_c_compatibility/cinttypes/functions.cc

index e9eec57e8963a537a3d77c86431493c4979328a6..b9a34d08a57fd63dc1c309b897950b51550c7265 100644 (file)
@@ -29,10 +29,10 @@ void test01()
 #if _GLIBCXX_USE_C99_INTTYPES_TR1
 
   std::tr1::intmax_t i = 0, numer = 0, denom = 0, base = 0;
-  const char* s = 0;
+  const char* s = "0";
   char** endptr = 0;
 #if defined(_GLIBCXX_USE_WCHAR_T) && _GLIBCXX_USE_C99_INTTYPES_WCHAR_T_TR1
-  const wchar_t* ws = 0;
+  const wchar_t* ws = L"0";
   wchar_t** wendptr = 0;
 #endif