* 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
+2007-10-17 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ * 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 <eweddington@cso.atmel.com>
* config/avr/avr.c (avr_mcu_types): Add at90pwm216, at90pwm316.
2007-10-16 Eric B. Weddington <eweddington@cso.atmel.com>
* config/avr/avr.c (avr_mcu_types): Add at90pwm216, at90pwm316.
if (! gave_help)
{
gave_help = true;
if (! gave_help)
{
gave_help = true;
- warning (0, "(so you should pass %qT not %qT to %<va_arg%>)",
+ inform ("(so you should pass %qT not %qT to %<va_arg%>)",
&& tree_expr_nonnegative_warnv_p (op2, &ovf)))
/* OK */;
else
&& 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");
if (!TREE_SIDE_EFFECTS (expr1))
{
/* The left-hand operand of a comma expression is like an expression
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)
{
any side-effects, unless it was explicitly cast to (void). */
if (warn_unused_value)
{
c_common_signed_type (result_type)))
/* OK */;
else
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
}
/* Warn if two unsigned values are being compared in a size
{
mask = (~(HOST_WIDE_INT) 0) << bits;
if ((mask & constant) != mask)
{
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
}
}
else if (unsignedp0 && unsignedp1
< TYPE_PRECISION (result_type))
&& (TYPE_PRECISION (TREE_TYPE (primop1))
< TYPE_PRECISION (result_type)))
< 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");
if (warn_stack_protect)
{
if (current_function_calls_alloca)
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)
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));
}
(int) PARAM_VALUE (PARAM_SSP_BUFFER_SIZE));
}
+2007-10-17 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ * typeck.c (build_binary_op) : Use appropriate warning option
+ instead of unnamed warning.
+
2007-10-16 Paolo Carlini <pcarlini@suse.de>
PR c++/31446
2007-10-16 Paolo Carlini <pcarlini@suse.de>
PR c++/31446
&& TYPE_MAIN_VARIANT (TREE_TYPE (orig_op0))
!= TYPE_MAIN_VARIANT (TREE_TYPE (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));
}
TREE_TYPE (orig_op0), TREE_TYPE (orig_op1));
}
(result_type)))))
/* OK */;
else
(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
/* Warn if two unsigned values are being compared in a size
larger than their original size, and one (and only one) is the
{
mask = (~ (HOST_WIDE_INT) 0) << bits;
if ((mask & constant) != mask)
{
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
}
}
else if (unsignedp0 && unsignedp1
< TYPE_PRECISION (result_type))
&& (TYPE_PRECISION (TREE_TYPE (primop1))
< TYPE_PRECISION (result_type)))
< 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");
- warning (0, "%Hvalue computed is not used", &locus);
+ warning (OPT_Wunused_value, "%Hvalue computed is not used", &locus);
int size_as_int = TREE_INT_CST_LOW (size);
if (compare_tree_int (size, size_as_int) == 0)
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);
- 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);
}
}
decl, larger_than_size);
}
}
if (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
pedwarn ("%q+F used but never defined", decl);
else
if (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
pedwarn ("%q+F used but never defined", decl);
else
- warning (0, "%q+F declared %<static%> but never defined", decl);
+ warning (OPT_Wunused_function, "%q+F declared %<static%> but never defined", decl);
/* This symbol is effectively an "extern" declaration now. */
TREE_PUBLIC (decl) = 1;
assemble_external (decl);
/* This symbol is effectively an "extern" declaration now. */
TREE_PUBLIC (decl) = 1;
assemble_external (decl);
&& ! (TREE_CODE (decl) == VAR_DECL && DECL_REGISTER (decl))
/* Otherwise, ask the language. */
&& lang_hooks.decls.warn_unused_global (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
}
/* Issue appropriate warnings for the global declarations in VEC (of
location_t loc = EXPR_LOCATION (stmt);
if (LOCATION_LINE (loc) > 0)
{
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);
location = EXPR_LOCATION (last);
if (location == UNKNOWN_LOCATION)
location = cfun->function_end_locus;
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;
#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;
#endif
TREE_NO_WARNING (cfun->decl) = 1;
break;
= TREE_INT_CST_LOW (TYPE_SIZE_UNIT (ret_type));
if (compare_tree_int (TYPE_SIZE_UNIT (ret_type), size_as_int) == 0)
= 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
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);
}
}
fndecl, larger_than_size);
}
}