aboutsummaryrefslogtreecommitdiff
path: root/gcc/configure.ac
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2024-09-19 15:50:19 -0400
committerJason Merrill <jason@redhat.com>2024-09-24 08:01:10 -0400
commit2249c3b459510f307b4f241ea4b14f6557035152 (patch)
tree3c55ee760ef2701ac5a533ccd89b8f30c063d2c9 /gcc/configure.ac
parentf5035d7d015ebd4a7f5df5831cfc1269f9567e06 (diff)
downloadgcc-2249c3b459510f307b4f241ea4b14f6557035152.zip
gcc-2249c3b459510f307b4f241ea4b14f6557035152.tar.gz
gcc-2249c3b459510f307b4f241ea4b14f6557035152.tar.bz2
build: enable C++11 narrowing warnings
We've been using -Wno-narrowing since gcc 4.7, but at this point narrowing diagnostics seem like a stable part of C++ and we should adjust. This patch changes -Wno-narrowing to -Wno-error=narrowing so that narrowing issues will still not break bootstrap, but we can see them. The rest of the patch fixes the narrowing warnings I see in an x86_64-pc-linux-gnu bootstrap. In most of the cases, by adjusting the types of various declarations so that we store the values in the same types we compute them in, which seems worthwhile anyway. This also allowed us to remove a few -Wsign-compare casts. gcc/ChangeLog: * configure.ac (CXX_WARNING_OPTS): Change -Wno-narrowing to -Wno-error=narrowing. * configure: Regenerate. * config/i386/i386.h (debugger_register_map) (debugger64_register_map) (svr4_debugger_register_map): Make unsigned. * config/i386/i386.cc: Likewise. * diagnostic-event-id.h (diagnostic_thread_id_t): Make int. * vec.h (vec::size): Make unsigned int. * ipa-modref.cc (escape_point::arg): Make unsigned. (modref_lattice::add_escape_point): Use eaf_flags_t. (update_escape_summary_1): Use eaf_flags_t, && for bool. * pair-fusion.cc (pair_fusion_bb_info::track_access): Make mem_size unsigned int. * pretty-print.cc (format_phase_2): Cast va_arg to char. * tree-ssa-loop-ch.cc (ch_base::copy_headers): Make nheaders unsigned, remove cast. * tree-ssa-structalias.cc (bitpos_of_field): Return unsigned. (push_fields_onto_fieldstack):Make offset unsigned, remove cast. * tree-vect-slp.cc (vect_prologue_cost_for_slp): Use nelt_limit. * tree-vect-stmts.cc (vect_truncate_gather_scatter_offset): Make scale unsigned. (vectorizable_operation): Make ncopies unsigned. * rtl-ssa/member-fns.inl: Make num_accesses unsigned int.
Diffstat (limited to 'gcc/configure.ac')
-rw-r--r--gcc/configure.ac3
1 files changed, 1 insertions, 2 deletions
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 8a2d2b0..23f4884 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -585,7 +585,6 @@ AC_SUBST(aliasing_flags)
# * 'long long'
# * variadic macros
# * overlong strings
-# * C++11 narrowing conversions in { }
# So, we only use -pedantic if we can disable those warnings.
# In stage 1, disable -Wformat warnings from old GCCs about new % codes
@@ -595,7 +594,7 @@ AC_ARG_ENABLE(build-format-warnings,
AS_IF([test $enable_build_format_warnings = no],
[wf_opt=-Wno-format],[wf_opt=])
ACX_PROG_CXX_WARNING_OPTS(
- m4_quote(m4_do([-W -Wall -Wno-narrowing -Wwrite-strings ],
+ m4_quote(m4_do([-W -Wall -Wno-error=narrowing -Wwrite-strings ],
[-Wcast-qual $wf_opt])),
[loose_warn])
ACX_PROG_CC_WARNING_OPTS(