diff mbox series

[committed] libstdc++: Fix -Wlong-long warning in <bits/postypes.h>

Message ID 20241002103412.3165515-1-jwakely@redhat.com
State New
Headers show
Series [committed] libstdc++: Fix -Wlong-long warning in <bits/postypes.h> | expand

Commit Message

Jonathan Wakely Oct. 2, 2024, 10:33 a.m. UTC
Tested x86_64-linux. Pushed to trunk.

-- >8 --

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 | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/libstdc++-v3/include/bits/postypes.h b/libstdc++-v3/include/bits/postypes.h
index 7bd973e089b..cf5f30187fd 100644
--- a/libstdc++-v3/include/bits/postypes.h
+++ b/libstdc++-v3/include/bits/postypes.h
@@ -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