Skip to content
Snippets Groups Projects
Commit 2249c3b4 authored by Jason Merrill's avatar Jason Merrill
Browse files

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.
parent f5035d7d
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment