diff options
author | Zack Weinberg <zack@gcc.gnu.org> | 2003-05-03 21:44:31 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2003-05-03 21:44:31 +0000 |
commit | 87f85ea0660e58ac0f2447d1c4a593863601df0e (patch) | |
tree | e37cc59b695cc55218915e90bcce25c7621fdf58 /gcc/stmt.c | |
parent | e7b5f0c9b4aa73a1de50162ae18101dab4f86ce4 (diff) | |
download | gcc-87f85ea0660e58ac0f2447d1c4a593863601df0e.zip gcc-87f85ea0660e58ac0f2447d1c4a593863601df0e.tar.gz gcc-87f85ea0660e58ac0f2447d1c4a593863601df0e.tar.bz2 |
re PR c/10604 (-Wall includes sign conversion warning [3.3 regression])
PR c/10604
* c-common.c (warn_sign_compare): Initialize to -1.
* c-opts.c (c_common_init_options): Don't set warn_sign_compare here.
(c_common_decode_option <OPT_Wall>): Set warn_sign_compare
for C++ only.
(c_common_post_options): Set warn_sign_compare from extra_warnings
if it's still -1 at this point.
* toplev.c (maybe_warn_unused_parameter): New static variable.
(set_Wextra): New static function.
(W_options): Remove "extra".
(decode_W_option): Call set_Wextra.
(independent_decode_option): Likewise.
(set_Wunused): Cooperate with set_Wextra in setting
warn_unused_parameter.
(rest_of_compilation): No need to check extra_warnings as
well as warn_uninitialized.
* c-typeck.c (build_binary_op, build_conditional_expr):
No need to check extra_warnings as well as warn_sign_compare.
(internal_build_compound_expr): No need to check extra_warnings
as well as warn_unused_value.
* function.c (expand_function_end): No need to check extra_warnings
as well as warn_unused_parameter.
* stmt.c (expand_expr_stmt_value): No need to check extra_warnings
as well as warn_unused_value.
* cp/typeck.c (build_x_compound_expr): No need to check
extra_warnings as well as warn_unused_value.
* doc/invoke.texi: Clarify documentation of -Wsign-compare.
* gcc.dg/compare7.c, g++.dg/warn/compare1.C: New testcases.
* Makefile.in: Disable -Werror for gengtype-lex.o.
From-SVN: r66436
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r-- | gcc/stmt.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -2174,7 +2174,7 @@ expand_expr_stmt_value (exp, want_value, maybe_last) { if (! TREE_SIDE_EFFECTS (exp)) { - if ((extra_warnings || warn_unused_value) + if (warn_unused_value && !(TREE_CODE (exp) == CONVERT_EXPR && VOID_TYPE_P (TREE_TYPE (exp)))) warning_with_file_and_line (emit_filename, emit_lineno, |