diff options
author | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-05-03 21:44:31 +0000 |
---|---|---|
committer | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-05-03 21:44:31 +0000 |
commit | 5125036ee955e150c78f80b56833a7eb27f84fde (patch) | |
tree | e37cc59b695cc55218915e90bcce25c7621fdf58 /gcc/stmt.c | |
parent | 0d32ca97ddd3e3ae7cf48ad5b102bbdcfac3ad71 (diff) | |
download | ppe42-gcc-5125036ee955e150c78f80b56833a7eb27f84fde.tar.gz ppe42-gcc-5125036ee955e150c78f80b56833a7eb27f84fde.zip |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66436 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r-- | gcc/stmt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/stmt.c b/gcc/stmt.c index 0fb7fb923b1..7c94359f4aa 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -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, |