From patchwork Fri Sep 27 22:56:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 98090 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5AC58385DDF0 for ; Fri, 27 Sep 2024 22:58:08 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 3FC88385DDD1 for ; Fri, 27 Sep 2024 22:56:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3FC88385DDD1 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3FC88385DDD1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727477822; cv=none; b=hOUq8DHPpMVBzfgUE1qwOHfxWCKEW3O8dJ+1ZbpK9z9qdviljOuiHT0hWI4b2ArKMpNu38wG5loyBPgwKEi2PKIE2vJ6ZCzPmEXXs4nXkw4GD0xZASyn/v1p1NK2Z9JYi1N7VT0ShZ9PpGwE9Um2s8vfiKXI0zcDKv2l1xLR0dA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727477822; c=relaxed/simple; bh=l9oI5TaDR5mIk74gdPqgf2mpBXSKObOiq2fSpBj1LNs=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=egNTO1ohGcdkeemmv8J2PImmgLq7hYITlpIAmIm8EPH8MSTzzlkXrF+4IzV0lCiBaLES3oNAEpCp0wUE202uZPkStxbkrDA3RsVco7BxKyRF2KdJBEIVfmnECwiUUt+RSX2x1d6L3JY9L7ZE8pYfMO8nJTj30EY6wIZpPkPBE+0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727477815; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yG0YJmI6sK1QnXIBfk447XknMBPWko4910Wvva9AJkg=; b=KgXH5LYibnb0yZlvcS7V38O3Ul1Jrkpye59IWZ0xiyJbCwfRzxW+4llDvtykMzizFtoX1I motW6O5jS7nEiF+aEgX/bEttJBalQbB7EYVCSfufO4lm6J6HEqxW1FQJR/7tfeUWzWiwK5 JL7wjyezCks4oKoYkEANGMUWKe4poaE= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-352-Cm5h8Th4Phyvgjro7OZNtg-1; Fri, 27 Sep 2024 18:56:53 -0400 X-MC-Unique: Cm5h8Th4Phyvgjro7OZNtg-1 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8A62D191040E; Fri, 27 Sep 2024 22:56:52 +0000 (UTC) Received: from localhost (unknown [10.42.28.136]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 016723003DF2; Fri, 27 Sep 2024 22:56:51 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Fix more pedwarns in headers for C++98 Date: Fri, 27 Sep 2024 23:56:43 +0100 Message-ID: <20240927225651.2382217-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org Tested x86_64-linux. Pushed to trunk. -- >8 -- Some tests e.g. 17_intro/headers/c++1998/all_pedantic_errors.cc FAIL with GLIBCXX_TESTSUITE_STDS=98 due to numerous C++11 extensions still in use in the library headers. The recent changes to not make them system headers means we get warnings now. This change adds more diagnostic pragmas to suppress those warnings. libstdc++-v3/ChangeLog: * include/bits/istream.tcc: Add diagnostic pragmas around uses of long long and extern template. * include/bits/locale_facets.h: Likewise. * include/bits/locale_facets.tcc: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/ostream.tcc: Likewise. * include/bits/stl_algobase.h: Likewise. * include/c_global/cstdlib: Likewise. * include/ext/pb_ds/detail/resize_policy/hash_prime_size_policy_imp.hpp: Likewise. * include/ext/pointer.h: Likewise. * include/ext/stdio_sync_filebuf.h: Likewise. * include/std/istream: Likewise. * include/std/ostream: Likewise. * include/tr1/cmath: Likewise. * include/tr1/type_traits: Likewise. * include/tr1/functional_hash.h: Likewise. Remove semi-colons at namespace scope that aren't needed after macro expansion. * include/tr1/tuple: Remove semi-colon at namespace scope. * include/bits/vector.tcc: Change LL suffix to just L. --- libstdc++-v3/include/bits/istream.tcc | 10 ++++++ libstdc++-v3/include/bits/locale_facets.h | 12 +++++++ libstdc++-v3/include/bits/locale_facets.tcc | 6 ++++ .../include/bits/locale_facets_nonio.tcc | 4 +++ libstdc++-v3/include/bits/ostream.tcc | 6 ++++ libstdc++-v3/include/bits/stl_algobase.h | 10 ++++++ libstdc++-v3/include/bits/vector.tcc | 2 +- libstdc++-v3/include/c_global/cstdlib | 3 ++ .../hash_prime_size_policy_imp.hpp | 3 ++ libstdc++-v3/include/ext/pointer.h | 3 ++ libstdc++-v3/include/ext/stdio_sync_filebuf.h | 3 ++ libstdc++-v3/include/std/istream | 3 ++ libstdc++-v3/include/std/ostream | 3 ++ libstdc++-v3/include/tr1/cmath | 4 +++ libstdc++-v3/include/tr1/functional_hash.h | 32 +++++++++++-------- libstdc++-v3/include/tr1/tuple | 2 +- libstdc++-v3/include/tr1/type_traits | 6 ++++ 17 files changed, 97 insertions(+), 15 deletions(-) diff --git a/libstdc++-v3/include/bits/istream.tcc b/libstdc++-v3/include/bits/istream.tcc index e8957fd2c3b..f96d2d4a353 100644 --- a/libstdc++-v3/include/bits/istream.tcc +++ b/libstdc++-v3/include/bits/istream.tcc @@ -397,7 +397,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __streambuf_type* __this_sb = this->rdbuf(); int_type __c = __this_sb->sgetc(); char_type __c2 = traits_type::to_char_type(__c); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wlong-long" unsigned long long __gcount = 0; +#pragma GCC diagnostic pop while (!traits_type::eq_int_type(__c, __eof) && !traits_type::eq_int_type(__c, __idelim) @@ -1122,6 +1125,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // Inhibit implicit instantiations for required instantiations, // which are defined via explicit instantiations elsewhere. #if _GLIBCXX_EXTERN_TEMPLATE +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wc++11-extensions" // extern template +#pragma GCC diagnostic ignored "-Wlong-long" extern template class basic_istream; extern template istream& ws(istream&); extern template istream& operator>>(istream&, char&); @@ -1134,8 +1140,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION extern template istream& istream::_M_extract(unsigned long&); extern template istream& istream::_M_extract(bool&); #ifdef _GLIBCXX_USE_LONG_LONG +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wlong-long" extern template istream& istream::_M_extract(long long&); extern template istream& istream::_M_extract(unsigned long long&); +#pragma GCC diagnostic pop #endif extern template istream& istream::_M_extract(float&); extern template istream& istream::_M_extract(double&); @@ -1166,6 +1175,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION extern template class basic_iostream; #endif +#pragma GCC diagnostic pop #endif _GLIBCXX_END_NAMESPACE_VERSION diff --git a/libstdc++-v3/include/bits/locale_facets.h b/libstdc++-v3/include/bits/locale_facets.h index afa239ad96a..0daffc86de2 100644 --- a/libstdc++-v3/include/bits/locale_facets.h +++ b/libstdc++-v3/include/bits/locale_facets.h @@ -2063,6 +2063,8 @@ _GLIBCXX_BEGIN_NAMESPACE_LDBL { return this->do_get(__in, __end, __io, __err, __v); } #ifdef _GLIBCXX_USE_LONG_LONG +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wlong-long" iter_type get(iter_type __in, iter_type __end, ios_base& __io, ios_base::iostate& __err, long long& __v) const @@ -2072,6 +2074,7 @@ _GLIBCXX_BEGIN_NAMESPACE_LDBL get(iter_type __in, iter_type __end, ios_base& __io, ios_base::iostate& __err, unsigned long long& __v) const { return this->do_get(__in, __end, __io, __err, __v); } +#pragma GCC diagnostic pop #endif ///@} @@ -2242,6 +2245,8 @@ _GLIBCXX_BEGIN_NAMESPACE_LDBL { return _M_extract_int(__beg, __end, __io, __err, __v); } #ifdef _GLIBCXX_USE_LONG_LONG +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wlong-long" virtual iter_type do_get(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, long long& __v) const @@ -2251,6 +2256,7 @@ _GLIBCXX_BEGIN_NAMESPACE_LDBL do_get(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, unsigned long long& __v) const { return _M_extract_int(__beg, __end, __io, __err, __v); } +#pragma GCC diagnostic pop #endif virtual iter_type @@ -2407,6 +2413,8 @@ _GLIBCXX_BEGIN_NAMESPACE_LDBL { return this->do_put(__s, __io, __fill, __v); } #ifdef _GLIBCXX_USE_LONG_LONG +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wlong-long" iter_type put(iter_type __s, ios_base& __io, char_type __fill, long long __v) const { return this->do_put(__s, __io, __fill, __v); } @@ -2415,6 +2423,7 @@ _GLIBCXX_BEGIN_NAMESPACE_LDBL put(iter_type __s, ios_base& __io, char_type __fill, unsigned long long __v) const { return this->do_put(__s, __io, __fill, __v); } +#pragma GCC diagnostic pop #endif ///@} @@ -2546,6 +2555,8 @@ _GLIBCXX_BEGIN_NAMESPACE_LDBL { return _M_insert_int(__s, __io, __fill, __v); } #ifdef _GLIBCXX_USE_LONG_LONG +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wlong-long" virtual iter_type do_put(iter_type __s, ios_base& __io, char_type __fill, long long __v) const @@ -2555,6 +2566,7 @@ _GLIBCXX_BEGIN_NAMESPACE_LDBL do_put(iter_type __s, ios_base& __io, char_type __fill, unsigned long long __v) const { return _M_insert_int(__s, __io, __fill, __v); } +#pragma GCC diagnostic pop #endif virtual iter_type diff --git a/libstdc++-v3/include/bits/locale_facets.tcc b/libstdc++-v3/include/bits/locale_facets.tcc index 14e87ab0ed3..1486d0027a5 100644 --- a/libstdc++-v3/include/bits/locale_facets.tcc +++ b/libstdc++-v3/include/bits/locale_facets.tcc @@ -762,9 +762,12 @@ _GLIBCXX_BEGIN_NAMESPACE_LDBL const fmtflags __fmt = __io.flags(); __io.flags((__fmt & ~ios_base::basefield) | ios_base::hex); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wlong-long" typedef __gnu_cxx::__conditional_type<(sizeof(void*) <= sizeof(unsigned long)), unsigned long, unsigned long long>::__type _UIntPtrType; +#pragma GCC diagnostic pop _UIntPtrType __ul; __beg = _M_extract_int(__beg, __end, __io, __err, __ul); @@ -1206,9 +1209,12 @@ _GLIBCXX_BEGIN_NAMESPACE_LDBL | ios_base::uppercase); __io.flags((__flags & __fmt) | (ios_base::hex | ios_base::showbase)); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wlong-long" typedef __gnu_cxx::__conditional_type<(sizeof(const void*) <= sizeof(unsigned long)), unsigned long, unsigned long long>::__type _UIntPtrType; +#pragma GCC diagnostic pop __s = _M_insert_int(__s, __io, __fill, reinterpret_cast<_UIntPtrType>(__v)); diff --git a/libstdc++-v3/include/bits/locale_facets_nonio.tcc b/libstdc++-v3/include/bits/locale_facets_nonio.tcc index 7b597c86aea..5fddc1e3b26 100644 --- a/libstdc++-v3/include/bits/locale_facets_nonio.tcc +++ b/libstdc++-v3/include/bits/locale_facets_nonio.tcc @@ -1679,6 +1679,9 @@ _GLIBCXX_END_NAMESPACE_LDBL_OR_CXX11 // Inhibit implicit instantiations for required instantiations, // which are defined via explicit instantiations elsewhere. #if _GLIBCXX_EXTERN_TEMPLATE +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wc++11-extensions" // extern template +#pragma GCC diagnostic ignored "-Wlong-long" extern template class moneypunct; extern template class moneypunct; extern template class moneypunct_byname; @@ -1892,6 +1895,7 @@ _GLIBCXX_END_NAMESPACE_LDBL_OR_CXX11 bool has_facet >(const locale&); #endif +#pragma GCC diagnostic pop #endif _GLIBCXX_END_NAMESPACE_VERSION diff --git a/libstdc++-v3/include/bits/ostream.tcc b/libstdc++-v3/include/bits/ostream.tcc index 06cf2da1e07..bda342f24b4 100644 --- a/libstdc++-v3/include/bits/ostream.tcc +++ b/libstdc++-v3/include/bits/ostream.tcc @@ -361,8 +361,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION extern template ostream& ostream::_M_insert(unsigned long); extern template ostream& ostream::_M_insert(bool); #ifdef _GLIBCXX_USE_LONG_LONG +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wlong-long" extern template ostream& ostream::_M_insert(long long); extern template ostream& ostream::_M_insert(unsigned long long); +#pragma GCC diagnostic pop #endif extern template ostream& ostream::_M_insert(double); extern template ostream& ostream::_M_insert(long double); @@ -382,8 +385,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION extern template wostream& wostream::_M_insert(unsigned long); extern template wostream& wostream::_M_insert(bool); #ifdef _GLIBCXX_USE_LONG_LONG +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wlong-long" extern template wostream& wostream::_M_insert(long long); extern template wostream& wostream::_M_insert(unsigned long long); +#pragma GCC diagnostic pop #endif extern template wostream& wostream::_M_insert(double); extern template wostream& wostream::_M_insert(long double); diff --git a/libstdc++-v3/include/bits/stl_algobase.h b/libstdc++-v3/include/bits/stl_algobase.h index f13662fc448..9e92211c124 100644 --- a/libstdc++-v3/include/bits/stl_algobase.h +++ b/libstdc++-v3/include/bits/stl_algobase.h @@ -937,6 +937,8 @@ _GLIBCXX_END_NAMESPACE_CONTAINER __fill_a1(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wlong-long" // We can optimize this loop by moving the load from __value outside // the loop, but only if we know that making that copy is trivial, // and the assignment in the loop is also trivial (so that the identity @@ -951,6 +953,7 @@ _GLIBCXX_END_NAMESPACE_CONTAINER && __is_same(_Tp, __typeof__(*__first)) #endif && sizeof(_Tp) <= sizeof(long long); +#pragma GCC diagnostic pop // When the condition is true, we use a copy of __value, // otherwise we just use another reference. @@ -1040,6 +1043,8 @@ _GLIBCXX_END_NAMESPACE_CONTAINER std::__fill_a(__first, __last, __value); } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wlong-long" // Used by fill_n, generate_n, etc. to convert _Size to an integral type: inline _GLIBCXX_CONSTEXPR int __size_to_integer(int __n) { return __n; } @@ -1089,9 +1094,11 @@ _GLIBCXX_END_NAMESPACE_CONTAINER __extension__ inline _GLIBCXX_CONSTEXPR long long __size_to_integer(__float128 __n) { return (long long)__n; } #endif +#pragma GCC diagnostic pop #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wc++17-extensions" +#pragma GCC diagnostic ignored "-Wlong-long" template _GLIBCXX20_CONSTEXPR inline _OutputIterator @@ -1574,6 +1581,8 @@ _GLIBCXX_END_NAMESPACE_CONTAINER #if __cplusplus >= 201402L return std::__bit_width(make_unsigned_t<_Tp>(__n)) - 1; #else +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wlong-long" // Use +__n so it promotes to at least int. return (sizeof(+__n) * __CHAR_BIT__ - 1) - (sizeof(+__n) == sizeof(long long) @@ -1581,6 +1590,7 @@ _GLIBCXX_END_NAMESPACE_CONTAINER : (sizeof(+__n) == sizeof(long) ? __builtin_clzl(+__n) : __builtin_clz(+__n))); +#pragma GCC diagnostic pop #endif } diff --git a/libstdc++-v3/include/bits/vector.tcc b/libstdc++-v3/include/bits/vector.tcc index c500aab9e56..a99a5b56b77 100644 --- a/libstdc++-v3/include/bits/vector.tcc +++ b/libstdc++-v3/include/bits/vector.tcc @@ -933,7 +933,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER const size_type __len = _M_check_len(__n, "vector::_M_range_insert"); -#if __cplusplus < 201103LL +#if __cplusplus < 201103L if (__len < (__n + (__old_start - __old_finish))) __builtin_unreachable(); #endif diff --git a/libstdc++-v3/include/c_global/cstdlib b/libstdc++-v3/include/c_global/cstdlib index a5df4cd9cb1..590e17cf7a1 100644 --- a/libstdc++-v3/include/c_global/cstdlib +++ b/libstdc++-v3/include/c_global/cstdlib @@ -217,6 +217,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #endif #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wlong-long" using ::llabs; inline lldiv_t @@ -224,6 +226,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; } using ::lldiv; +#pragma GCC diagnostic pop #endif #if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC diff --git a/libstdc++-v3/include/ext/pb_ds/detail/resize_policy/hash_prime_size_policy_imp.hpp b/libstdc++-v3/include/ext/pb_ds/detail/resize_policy/hash_prime_size_policy_imp.hpp index 8fdec6d5754..910a670dd03 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/resize_policy/hash_prime_size_policy_imp.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/resize_policy/hash_prime_size_policy_imp.hpp @@ -62,6 +62,8 @@ namespace detail #endif }; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wlong-long" // Originally taken from the SGI implementation; acknowledged in the docs. // Further modified (for 64 bits) from tr1's hashtable. static const std::size_t g_a_sizes[num_distinct_sizes] = @@ -133,6 +135,7 @@ namespace detail #endif #endif }; +#pragma GCC diagnostic pop } // namespace detail diff --git a/libstdc++-v3/include/ext/pointer.h b/libstdc++-v3/include/ext/pointer.h index ab3016e225d..ae0a9a1280c 100644 --- a/libstdc++-v3/include/ext/pointer.h +++ b/libstdc++-v3/include/ext/pointer.h @@ -439,8 +439,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _CXX_POINTER_ARITH_OPERATOR_SET(long); _CXX_POINTER_ARITH_OPERATOR_SET(unsigned long); #ifdef _GLIBCXX_USE_LONG_LONG +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wlong-long" _CXX_POINTER_ARITH_OPERATOR_SET(long long); _CXX_POINTER_ARITH_OPERATOR_SET(unsigned long long); +#pragma GCC diagnostic pop #endif // Mathematical Manipulators diff --git a/libstdc++-v3/include/ext/stdio_sync_filebuf.h b/libstdc++-v3/include/ext/stdio_sync_filebuf.h index 0f5381d9cb5..26c5783bb8d 100644 --- a/libstdc++-v3/include/ext/stdio_sync_filebuf.h +++ b/libstdc++-v3/include/ext/stdio_sync_filebuf.h @@ -310,10 +310,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #endif #if _GLIBCXX_EXTERN_TEMPLATE +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wc++11-extensions" extern template class stdio_sync_filebuf; #ifdef _GLIBCXX_USE_WCHAR_T extern template class stdio_sync_filebuf; #endif +#pragma GCC diagnostic pop #endif _GLIBCXX_END_NAMESPACE_VERSION diff --git a/libstdc++-v3/include/std/istream b/libstdc++-v3/include/std/istream index 54a130d82f0..ef773977ed4 100644 --- a/libstdc++-v3/include/std/istream +++ b/libstdc++-v3/include/std/istream @@ -195,6 +195,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return _M_extract(__n); } #ifdef _GLIBCXX_USE_LONG_LONG +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wlong-long" __istream_type& operator>>(long long& __n) { return _M_extract(__n); } @@ -202,6 +204,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __istream_type& operator>>(unsigned long long& __n) { return _M_extract(__n); } +#pragma GCC diagnostic pop #endif ///@} diff --git a/libstdc++-v3/include/std/ostream b/libstdc++-v3/include/std/ostream index a1cb7ce1765..637aad5a5a4 100644 --- a/libstdc++-v3/include/std/ostream +++ b/libstdc++-v3/include/std/ostream @@ -207,6 +207,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } #ifdef _GLIBCXX_USE_LONG_LONG +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wlong-long" __ostream_type& operator<<(long long __n) { return _M_insert(__n); } @@ -214,6 +216,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __ostream_type& operator<<(unsigned long long __n) { return _M_insert(__n); } +#pragma GCC diagnostic pop #endif ///@} diff --git a/libstdc++-v3/include/tr1/cmath b/libstdc++-v3/include/tr1/cmath index bc1e562084a..2057538af85 100644 --- a/libstdc++-v3/include/tr1/cmath +++ b/libstdc++-v3/include/tr1/cmath @@ -762,6 +762,9 @@ namespace tr1 lgamma(_Tp __x) { return __builtin_lgamma(__x); } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wlong-long" + #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP inline long long llrint(float __x) @@ -793,6 +796,7 @@ namespace tr1 long long>::__type llround(_Tp __x) { return __builtin_llround(__x); } +#pragma GCC diagnostic pop #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP inline float diff --git a/libstdc++-v3/include/tr1/functional_hash.h b/libstdc++-v3/include/tr1/functional_hash.h index 01ebfc907db..707d35f9da9 100644 --- a/libstdc++-v3/include/tr1/functional_hash.h +++ b/libstdc++-v3/include/tr1/functional_hash.h @@ -71,19 +71,22 @@ namespace tr1 hash<_Tp>::operator()(_Tp __val) const \ { return static_cast(__val); } - _TR1_hashtable_define_trivial_hash(bool); - _TR1_hashtable_define_trivial_hash(char); - _TR1_hashtable_define_trivial_hash(signed char); - _TR1_hashtable_define_trivial_hash(unsigned char); - _TR1_hashtable_define_trivial_hash(wchar_t); - _TR1_hashtable_define_trivial_hash(short); - _TR1_hashtable_define_trivial_hash(int); - _TR1_hashtable_define_trivial_hash(long); - _TR1_hashtable_define_trivial_hash(long long); - _TR1_hashtable_define_trivial_hash(unsigned short); - _TR1_hashtable_define_trivial_hash(unsigned int); - _TR1_hashtable_define_trivial_hash(unsigned long); - _TR1_hashtable_define_trivial_hash(unsigned long long); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wlong-long" + _TR1_hashtable_define_trivial_hash(bool) + _TR1_hashtable_define_trivial_hash(char) + _TR1_hashtable_define_trivial_hash(signed char) + _TR1_hashtable_define_trivial_hash(unsigned char) + _TR1_hashtable_define_trivial_hash(wchar_t) + _TR1_hashtable_define_trivial_hash(short) + _TR1_hashtable_define_trivial_hash(int) + _TR1_hashtable_define_trivial_hash(long) + _TR1_hashtable_define_trivial_hash(long long) + _TR1_hashtable_define_trivial_hash(unsigned short) + _TR1_hashtable_define_trivial_hash(unsigned int) + _TR1_hashtable_define_trivial_hash(unsigned long) + _TR1_hashtable_define_trivial_hash(unsigned long long) +#pragma GCC diagnostic pop #undef _TR1_hashtable_define_trivial_hash @@ -135,6 +138,8 @@ namespace tr1 static size_t hash(const _Tp* __ptr, size_t __clength) { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wlong-long" size_t __result = static_cast(14695981039346656037ULL); const char* __cptr = reinterpret_cast(__ptr); @@ -144,6 +149,7 @@ namespace tr1 __result *= static_cast(1099511628211ULL); } return __result; +#pragma GCC diagnostic pop } }; diff --git a/libstdc++-v3/include/tr1/tuple b/libstdc++-v3/include/tr1/tuple index e53fca75944..b5c62b585a9 100644 --- a/libstdc++-v3/include/tr1/tuple +++ b/libstdc++-v3/include/tr1/tuple @@ -424,7 +424,7 @@ namespace tr1 namespace { _Swallow_assign ignore; - }; // anonymous namespace + } // anonymous namespace } _GLIBCXX_END_NAMESPACE_VERSION diff --git a/libstdc++-v3/include/tr1/type_traits b/libstdc++-v3/include/tr1/type_traits index c4ce2d7125c..5e55802fba7 100644 --- a/libstdc++-v3/include/tr1/type_traits +++ b/libstdc++-v3/include/tr1/type_traits @@ -123,8 +123,11 @@ namespace tr1 _DEFINE_SPEC(0, __is_integral_helper, unsigned int, true) _DEFINE_SPEC(0, __is_integral_helper, long, true) _DEFINE_SPEC(0, __is_integral_helper, unsigned long, true) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wlong-long" _DEFINE_SPEC(0, __is_integral_helper, long long, true) _DEFINE_SPEC(0, __is_integral_helper, unsigned long long, true) +#pragma GCC diagnostic pop /// is_integral template @@ -544,6 +547,8 @@ namespace tr1 : public integral_constant::value> { }; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wlong-long" template struct __is_signed_helper : public false_type { }; @@ -567,6 +572,7 @@ namespace tr1 _DEFINE_SPEC(0, __is_unsigned_helper, unsigned int, true) _DEFINE_SPEC(0, __is_unsigned_helper, unsigned long, true) _DEFINE_SPEC(0, __is_unsigned_helper, unsigned long long, true) +#pragma GCC diagnostic pop template struct is_unsigned