aboutsummaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@gcc.gnu.org>2003-05-03 21:44:31 +0000
committerZack Weinberg <zack@gcc.gnu.org>2003-05-03 21:44:31 +0000
commit87f85ea0660e58ac0f2447d1c4a593863601df0e (patch)
treee37cc59b695cc55218915e90bcce25c7621fdf58 /gcc/function.c
parente7b5f0c9b4aa73a1de50162ae18101dab4f86ce4 (diff)
downloadgcc-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/function.c')
-rw-r--r--gcc/function.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/gcc/function.c b/gcc/function.c
index 5684392..232771e 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -6956,13 +6956,8 @@ expand_function_end (filename, line, end_bindings)
}
}
- /* Warn about unused parms if extra warnings were specified. */
- /* Either ``-Wextra -Wunused'' or ``-Wunused-parameter'' enables this
- warning. WARN_UNUSED_PARAMETER is negative when set by
- -Wunused. Note that -Wall implies -Wunused, so ``-Wall -Wextra'' will
- also give these warnings. */
- if (warn_unused_parameter > 0
- || (warn_unused_parameter < 0 && extra_warnings))
+ /* Possibly warn about unused parameters. */
+ if (warn_unused_parameter)
{
tree decl;