]> gcc.gnu.org Git - gcc.git/commit
libstdc++: add #pragma diagnostic
authorJason Merrill <jason@redhat.com>
Fri, 22 Dec 2023 18:20:35 +0000 (13:20 -0500)
committerJason Merrill <jason@redhat.com>
Thu, 19 Sep 2024 14:23:16 +0000 (10:23 -0400)
commitd3a7302ec5985abcda561886cc724d388c7143cb
tree587ad5067908ca764873a75bf56c4c5fb0e1246b
parent605d05b9481832bc691685b7ff990ef68f02b1bb
libstdc++: add #pragma diagnostic

The use of #pragma GCC system_header in libstdc++ has led to bugs going
undetected for a while due to the silencing of compiler warnings that would
have revealed them promptly, and also interferes with warnings about
problematic template instantiations induced by user code.

But removing it, or even compiling with -Wsystem-header, is also problematic
due to warnings about deliberate uses of extensions.

So this patch adds #pragma GCC diagnostic as needed to suppress these
warnings.

The change to acinclude.m4 changes -Wabi to warn only in comparison to ABI
19, to avoid lots of warnings that we now mangle concept requirements, which
are in any case still experimental.  I checked for any other changes against
ABI v15, and found only the <format> lambda mangling, which we can ignore.

This also enables -Wsystem-headers while building the library, so we see any
warnings not silenced by these #pragmas.

libstdc++-v3/ChangeLog:

* include/bits/algorithmfwd.h:
* include/bits/allocator.h:
* include/bits/codecvt.h:
* include/bits/concept_check.h:
* include/bits/cpp_type_traits.h:
* include/bits/hashtable.h:
* include/bits/iterator_concepts.h:
* include/bits/ostream_insert.h:
* include/bits/ranges_base.h:
* include/bits/regex_automaton.h:
* include/bits/std_abs.h:
* include/bits/stl_algo.h:
* include/c_compatibility/fenv.h:
* include/c_compatibility/inttypes.h:
* include/c_compatibility/stdint.h:
* include/ext/concurrence.h:
* include/ext/type_traits.h:
* testsuite/ext/type_traits/add_unsigned_floating_neg.cc:
* testsuite/ext/type_traits/add_unsigned_integer_neg.cc:
* testsuite/ext/type_traits/remove_unsigned_floating_neg.cc:
* testsuite/ext/type_traits/remove_unsigned_integer_neg.cc:
* include/bits/basic_ios.tcc:
* include/bits/basic_string.tcc:
* include/bits/fstream.tcc:
* include/bits/istream.tcc:
* include/bits/locale_classes.tcc:
* include/bits/locale_facets.tcc:
* include/bits/ostream.tcc:
* include/bits/regex_compiler.tcc:
* include/bits/sstream.tcc:
* include/bits/streambuf.tcc:
* configure: Regenerate.
* include/bits/c++config:
* include/c/cassert:
* include/c/cctype:
* include/c/cerrno:
* include/c/cfloat:
* include/c/climits:
* include/c/clocale:
* include/c/cmath:
* include/c/csetjmp:
* include/c/csignal:
* include/c/cstdarg:
* include/c/cstddef:
* include/c/cstdio:
* include/c/cstdlib:
* include/c/cstring:
* include/c/ctime:
* include/c/cwchar:
* include/c/cwctype:
* include/c_global/climits:
* include/c_global/cmath:
* include/c_global/cstddef:
* include/c_global/cstdlib:
* include/decimal/decimal:
* include/ext/rope:
* include/std/any:
* include/std/charconv:
* include/std/complex:
* include/std/coroutine:
* include/std/format:
* include/std/iomanip:
* include/std/limits:
* include/std/numbers:
* include/tr1/functional:
* include/tr1/tuple:
* include/tr1/type_traits:
* libsupc++/compare:
* libsupc++/new: Add #pragma GCC diagnostic to suppress
undesired warnings.
* acinclude.m4: Change -Wabi version from 2 to 19.

gcc/ChangeLog:

* ginclude/stdint-wrap.h: Add #pragma GCC diagnostic to suppress
undesired warnings.
* gsyslimits.h: Likewise.
72 files changed:
gcc/ginclude/stdint-wrap.h
gcc/gsyslimits.h
libstdc++-v3/acinclude.m4
libstdc++-v3/configure
libstdc++-v3/include/bits/algorithmfwd.h
libstdc++-v3/include/bits/allocator.h
libstdc++-v3/include/bits/basic_ios.tcc
libstdc++-v3/include/bits/basic_string.tcc
libstdc++-v3/include/bits/c++config
libstdc++-v3/include/bits/codecvt.h
libstdc++-v3/include/bits/concept_check.h
libstdc++-v3/include/bits/cpp_type_traits.h
libstdc++-v3/include/bits/fstream.tcc
libstdc++-v3/include/bits/hashtable.h
libstdc++-v3/include/bits/istream.tcc
libstdc++-v3/include/bits/iterator_concepts.h
libstdc++-v3/include/bits/locale_classes.tcc
libstdc++-v3/include/bits/locale_facets.tcc
libstdc++-v3/include/bits/ostream.tcc
libstdc++-v3/include/bits/ostream_insert.h
libstdc++-v3/include/bits/ranges_base.h
libstdc++-v3/include/bits/regex_automaton.h
libstdc++-v3/include/bits/regex_compiler.tcc
libstdc++-v3/include/bits/sstream.tcc
libstdc++-v3/include/bits/std_abs.h
libstdc++-v3/include/bits/stl_algo.h
libstdc++-v3/include/bits/streambuf.tcc
libstdc++-v3/include/c/cassert
libstdc++-v3/include/c/cctype
libstdc++-v3/include/c/cerrno
libstdc++-v3/include/c/cfloat
libstdc++-v3/include/c/climits
libstdc++-v3/include/c/clocale
libstdc++-v3/include/c/cmath
libstdc++-v3/include/c/csetjmp
libstdc++-v3/include/c/csignal
libstdc++-v3/include/c/cstdarg
libstdc++-v3/include/c/cstddef
libstdc++-v3/include/c/cstdio
libstdc++-v3/include/c/cstdlib
libstdc++-v3/include/c/cstring
libstdc++-v3/include/c/ctime
libstdc++-v3/include/c/cwchar
libstdc++-v3/include/c/cwctype
libstdc++-v3/include/c_compatibility/fenv.h
libstdc++-v3/include/c_compatibility/inttypes.h
libstdc++-v3/include/c_compatibility/stdint.h
libstdc++-v3/include/c_global/climits
libstdc++-v3/include/c_global/cmath
libstdc++-v3/include/c_global/cstddef
libstdc++-v3/include/c_global/cstdlib
libstdc++-v3/include/decimal/decimal
libstdc++-v3/include/ext/concurrence.h
libstdc++-v3/include/ext/rope
libstdc++-v3/include/ext/type_traits.h
libstdc++-v3/include/std/any
libstdc++-v3/include/std/charconv
libstdc++-v3/include/std/complex
libstdc++-v3/include/std/coroutine
libstdc++-v3/include/std/format
libstdc++-v3/include/std/iomanip
libstdc++-v3/include/std/limits
libstdc++-v3/include/std/numbers
libstdc++-v3/include/tr1/functional
libstdc++-v3/include/tr1/tuple
libstdc++-v3/include/tr1/type_traits
libstdc++-v3/libsupc++/compare
libstdc++-v3/libsupc++/new
libstdc++-v3/testsuite/ext/type_traits/add_unsigned_floating_neg.cc
libstdc++-v3/testsuite/ext/type_traits/add_unsigned_integer_neg.cc
libstdc++-v3/testsuite/ext/type_traits/remove_unsigned_floating_neg.cc
libstdc++-v3/testsuite/ext/type_traits/remove_unsigned_integer_neg.cc
This page took 0.075689 seconds and 5 git commands to generate.