From: manu Date: Wed, 17 Oct 2007 00:11:25 +0000 (+0000) Subject: 2007-10-17 Manuel Lopez-Ibanez X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=commitdiff_plain;h=2006d7dcc08bb35118582162477f5dc088dcaea2;ds=sidebyside 2007-10-17 Manuel Lopez-Ibanez * builtins.c (gimplify_va_arg_expr): Use inform for help message. * toplev.c (check_global_declaration_1): Use appropriate warning option instead of unnamed warning. * stor-layout.c (layout_decl): Likewise. * c-typeck.c (build_conditional_expr): Likewise. (build_compound_expr): Fix wrong comment. (build_binary_op): Use appropriate warning option instead of unnamed warning. * cfgexpand.c (tree_expand_cfg): Likewise. * tree-optimize.c (tree_rest_of_compilation): Likewise. * tree-cfg.c (remove_useless_stmts_warn_notreached): Likewise. (execute_warn_function_return): Likewise. * stmt.c (warn_if_unused_value): Likewise. cp/ * typeck.c (build_binary_op) : Use appropriate warning option instead of unnamed warning. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@129393 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 36326b98503..e2bf83b5582 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,19 @@ +2007-10-17 Manuel Lopez-Ibanez + + * builtins.c (gimplify_va_arg_expr): Use inform for help message. + * toplev.c (check_global_declaration_1): Use appropriate warning + option instead of unnamed warning. + * stor-layout.c (layout_decl): Likewise. + * c-typeck.c (build_conditional_expr): Likewise. + (build_compound_expr): Fix wrong comment. + (build_binary_op): Use appropriate warning option instead of + unnamed warning. + * cfgexpand.c (tree_expand_cfg): Likewise. + * tree-optimize.c (tree_rest_of_compilation): Likewise. + * tree-cfg.c (remove_useless_stmts_warn_notreached): Likewise. + (execute_warn_function_return): Likewise. + * stmt.c (warn_if_unused_value): Likewise. + 2007-10-16 Eric B. Weddington * config/avr/avr.c (avr_mcu_types): Add at90pwm216, at90pwm316. diff --git a/gcc/builtins.c b/gcc/builtins.c index bafdce0779f..4f4cba250ed 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -4873,7 +4873,7 @@ gimplify_va_arg_expr (tree *expr_p, tree *pre_p, tree *post_p) if (! gave_help) { gave_help = true; - warning (0, "(so you should pass %qT not %qT to %)", + inform ("(so you should pass %qT not %qT to %)", promoted_type, type); } diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 3d80ce2f275..9f3d9cbac49 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -3439,7 +3439,7 @@ build_conditional_expr (tree ifexp, tree op1, tree op2) && tree_expr_nonnegative_warnv_p (op2, &ovf))) /* OK */; else - warning (0, "signed and unsigned type in conditional expression"); + warning (OPT_Wsign_compare, "signed and unsigned type in conditional expression"); } } } @@ -3534,7 +3534,7 @@ build_compound_expr (tree expr1, tree expr2) if (!TREE_SIDE_EFFECTS (expr1)) { /* The left-hand operand of a comma expression is like an expression - statement: with -Wextra or -Wunused, we should warn if it doesn't have + statement: with -Wunused, we should warn if it doesn't have any side-effects, unless it was explicitly cast to (void). */ if (warn_unused_value) { @@ -8497,7 +8497,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, c_common_signed_type (result_type))) /* OK */; else - warning (0, "comparison between signed and unsigned"); + warning (OPT_Wsign_compare, "comparison between signed and unsigned"); } /* Warn if two unsigned values are being compared in a size @@ -8543,7 +8543,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, { mask = (~(HOST_WIDE_INT) 0) << bits; if ((mask & constant) != mask) - warning (0, "comparison of promoted ~unsigned with constant"); + warning (OPT_Wsign_compare, "comparison of promoted ~unsigned with constant"); } } else if (unsignedp0 && unsignedp1 @@ -8551,7 +8551,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, < TYPE_PRECISION (result_type)) && (TYPE_PRECISION (TREE_TYPE (primop1)) < TYPE_PRECISION (result_type))) - warning (0, "comparison of promoted ~unsigned with unsigned"); + warning (OPT_Wsign_compare, "comparison of promoted ~unsigned with unsigned"); } } } diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index e550a4c8b7e..769483b8b23 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -1877,9 +1877,11 @@ tree_expand_cfg (void) if (warn_stack_protect) { if (current_function_calls_alloca) - warning (0, "not protecting local variables: variable length buffer"); + warning (OPT_Wstack_protector, + "not protecting local variables: variable length buffer"); if (has_short_buffer && !cfun->stack_protect_guard) - warning (0, "not protecting function: no buffer at least %d bytes long", + warning (OPT_Wstack_protector, + "not protecting function: no buffer at least %d bytes long", (int) PARAM_VALUE (PARAM_SSP_BUFFER_SIZE)); } diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 5fd1c1b5e76..4283a88e249 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2007-10-17 Manuel Lopez-Ibanez + + * typeck.c (build_binary_op) : Use appropriate warning option + instead of unnamed warning. + 2007-10-16 Paolo Carlini PR c++/31446 diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index cfad878f875..392e2db3a99 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -3746,7 +3746,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, && TYPE_MAIN_VARIANT (TREE_TYPE (orig_op0)) != TYPE_MAIN_VARIANT (TREE_TYPE (orig_op1))) { - warning (0, "comparison between types %q#T and %q#T", + warning (OPT_Wsign_compare, "comparison between types %q#T and %q#T", TREE_TYPE (orig_op0), TREE_TYPE (orig_op1)); } @@ -3782,7 +3782,8 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, (result_type))))) /* OK */; else - warning (0, "comparison between signed and unsigned integer expressions"); + warning (OPT_Wsign_compare, + "comparison between signed and unsigned integer expressions"); /* Warn if two unsigned values are being compared in a size larger than their original size, and one (and only one) is the @@ -3826,7 +3827,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, { mask = (~ (HOST_WIDE_INT) 0) << bits; if ((mask & constant) != mask) - warning (0, "comparison of promoted ~unsigned with constant"); + warning (OPT_Wsign_compare, "comparison of promoted ~unsigned with constant"); } } else if (unsignedp0 && unsignedp1 @@ -3834,7 +3835,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, < TYPE_PRECISION (result_type)) && (TYPE_PRECISION (TREE_TYPE (primop1)) < TYPE_PRECISION (result_type))) - warning (0, "comparison of promoted ~unsigned with unsigned"); + warning (OPT_Wsign_compare, "comparison of promoted ~unsigned with unsigned"); } } } diff --git a/gcc/stmt.c b/gcc/stmt.c index 69cb5e0b860..f1be5e01aff 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -1479,7 +1479,7 @@ warn_if_unused_value (const_tree exp, location_t locus) return 0; warn: - warning (0, "%Hvalue computed is not used", &locus); + warning (OPT_Wunused_value, "%Hvalue computed is not used", &locus); return 1; } } diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index f149e68d537..226091709a2 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -464,9 +464,9 @@ layout_decl (tree decl, unsigned int known_align) int size_as_int = TREE_INT_CST_LOW (size); if (compare_tree_int (size, size_as_int) == 0) - warning (0, "size of %q+D is %d bytes", decl, size_as_int); + warning (OPT_Wlarger_than_, "size of %q+D is %d bytes", decl, size_as_int); else - warning (0, "size of %q+D is larger than %wd bytes", + warning (OPT_Wlarger_than_, "size of %q+D is larger than %wd bytes", decl, larger_than_size); } } diff --git a/gcc/toplev.c b/gcc/toplev.c index 944f1993100..f7f887a6db0 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -846,7 +846,7 @@ check_global_declaration_1 (tree decl) if (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))) pedwarn ("%q+F used but never defined", decl); else - warning (0, "%q+F declared % but never defined", decl); + warning (OPT_Wunused_function, "%q+F declared % but never defined", decl); /* This symbol is effectively an "extern" declaration now. */ TREE_PUBLIC (decl) = 1; assemble_external (decl); @@ -871,7 +871,10 @@ check_global_declaration_1 (tree decl) && ! (TREE_CODE (decl) == VAR_DECL && DECL_REGISTER (decl)) /* Otherwise, ask the language. */ && lang_hooks.decls.warn_unused_global (decl)) - warning (0, "%q+D defined but not used", decl); + warning ((TREE_CODE (decl) == FUNCTION_DECL) + ? OPT_Wunused_function + : OPT_Wunused_variable, + "%q+D defined but not used", decl); } /* Issue appropriate warnings for the global declarations in VEC (of diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 05c69b8ae02..69780c72423 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -1422,7 +1422,7 @@ remove_useless_stmts_warn_notreached (tree stmt) location_t loc = EXPR_LOCATION (stmt); if (LOCATION_LINE (loc) > 0) { - warning (0, "%Hwill never be executed", &loc); + warning (OPT_Wunreachable_code, "%Hwill never be executed", &loc); return true; } } @@ -6957,12 +6957,12 @@ execute_warn_function_return (void) location = EXPR_LOCATION (last); if (location == UNKNOWN_LOCATION) location = cfun->function_end_locus; - warning (0, "%Hcontrol reaches end of non-void function", &location); + warning (OPT_Wreturn_type, "%Hcontrol reaches end of non-void function", &location); #else locus = EXPR_LOCUS (last); if (!locus) locus = &cfun->function_end_locus; - warning (0, "%Hcontrol reaches end of non-void function", locus); + warning (OPT_Wreturn_type, "%Hcontrol reaches end of non-void function", locus); #endif TREE_NO_WARNING (cfun->decl) = 1; break; diff --git a/gcc/tree-optimize.c b/gcc/tree-optimize.c index e367bb7b445..cb30ba401cd 100644 --- a/gcc/tree-optimize.c +++ b/gcc/tree-optimize.c @@ -427,10 +427,10 @@ tree_rest_of_compilation (tree fndecl) = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (ret_type)); if (compare_tree_int (TYPE_SIZE_UNIT (ret_type), size_as_int) == 0) - warning (0, "size of return value of %q+D is %u bytes", + warning (OPT_Wlarger_than_, "size of return value of %q+D is %u bytes", fndecl, size_as_int); else - warning (0, "size of return value of %q+D is larger than %wd bytes", + warning (OPT_Wlarger_than_, "size of return value of %q+D is larger than %wd bytes", fndecl, larger_than_size); } }