]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix -Wlong-long warning in <bits/postypes.h>
authorJonathan Wakely <jwakely@redhat.com>
Tue, 1 Oct 2024 09:43:43 +0000 (10:43 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 2 Oct 2024 10:29:11 +0000 (11:29 +0100)
For 32-bit targets __INT64_TYPE__ expands to long long, which gives a
pedwarn for C++98 mode, causing:

FAIL: 17_intro/headers/c++1998/all_pedantic_errors.cc  -std=gnu++98 (test for excess errors)
Excess errors:
.../bits/postypes.h:64: error: ISO C++ 1998 does not support 'long long' [-Wlong-long]

libstdc++-v3/ChangeLog:

* include/bits/postypes.h: Fix -Wlong-long warning.

libstdc++-v3/include/bits/postypes.h

index 7bd973e089b6ddf904021a2216b4fd07604127c6..cf5f30187fded1f0459d54f40c058c080d7770dd 100644 (file)
@@ -52,6 +52,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   // unspecified. The behaviour in this implementation is as noted
   // below.
 
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wlong-long"
   /**
    *  @brief  Type used by fpos, char_traits<char>, and char_traits<wchar_t>.
    *
@@ -65,6 +67,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 #else
   typedef long long     streamoff;
 #endif
+#pragma GCC diagnostic pop
 
   /// Integral type for I/O operation counts and buffer sizes.
   typedef ptrdiff_t    streamsize; // Signed integral type