diagnostic.c (warning): Accept parameter to classify warning option.

* diagnostic.c (warning): Accept parameter to classify warning option.
(warning0): New, for when a pointer to an error() like function is needed.
* errors.c (warning): Likewise.
* errors.h (warning, warning0): Adjust prototypes.
* toplev.h (warning, warning0): Likewise.

* attribs.c, builtins.c, c-common.c, c-decl.c, c-format.c,
c-gimplify.c, c-lex.c, c-objc-common.c, c-opts.c, c-parser.c,
c-pragma.c, c-typeck.c, calls.c, cgraph.c, coverage.c, emit-rtl.c,
fold-const.c, fortran/trans-decl.c, function.c, gcse.c,
genautomata.c, haifa-sched.c, opts.c, passes.c, regclass.c,
reload1.c, stmt.c, stor-layout.c, toplev.c, tree-cfg.c,
tree-dump.c, tree-inline.c, tree-mudflap.c, tree-optimize.c,
tree-ssa.c, tree.c, varasm.c: Adjust warning() callers.

* config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c,
config/avr/avr.c, config/bfin/bfin.c, config/c4x/c4x-c.c,
config/c4x/c4x.c, config/cris/cris.c, config/darwin-c.c,
config/darwin.c, config/darwin.h, config/h8300/h8300.c,
config/i386/cygming.h, config/i386/djgpp.h, config/i386/i386.c,
config/i386/winnt.c, config/ia64/ia64-c.c, config/ia64/ia64.c,
config/ip2k/ip2k.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c,
config/m68k/m68k.c, config/mcore/mcore.c, config/mips/mips.c,
config/mmix/mmix.c, config/ns32k/ns32k.c, config/pa/pa-hpux11.h,
config/pa/pa.c, config/rs6000/aix43.h, config/rs6000/aix51.h,
config/rs6000/aix52.h, config/rs6000/darwin.h,
config/rs6000/rs6000-c.c, config/rs6000/rs6000.c,
config/s390/s390.c, config/sh/sh.c, config/sh/sh.h,
config/sh/symbian.c, config/sol2-c.c, config/sol2.c,
config/stormy16/stormy16.c, config/v850/v850-c.c,
config/v850/v850.c, config/xtensa/xtensa.c: Adjust warning()
callers.

* ada/misc.c: Adjust warning() callers.

* cp/call.c, cp/class.c, cp/cvt.c, cp/decl.c, cp/decl2.c,
cp/except.c, cp/friend.c, cp/init.c, cp/lex.c, cp/mangle.c,
cp/method.c, cp/name-lookup.c, cp/parser.c, cp/repo.c, cp/rtti.c,
cp/tree.c, cp/typeck.c, cp/typeck2.c: Adjust warning() callers.

* fortran/trans-decl.c: Adjust warning() callers.

* java/class.c, java/decl.c, java/expr.c, java/jcf-io.c,
java/jcf-parse.c, java/jv-scan.c, java/parse.y: Adjust warning()
callers.

* objc/objc-act.c: Adjust warning() callers.

* treelang/parse.y: Adjust warning() callers.

From-SVN: r98633
This commit is contained in:
DJ Delorie 2005-04-23 17:29:07 -04:00 committed by DJ Delorie
parent 6084512671
commit d4ee4d2525
120 changed files with 903 additions and 815 deletions

View File

@ -1,3 +1,38 @@
2005-04-23 DJ Delorie <dj@redhat.com>
* diagnostic.c (warning): Accept parameter to classify warning option.
(warning0): New, for when a pointer to an error() like function is needed.
* errors.c (warning): Likewise.
* errors.h (warning, warning0): Adjust prototypes.
* toplev.h (warning, warning0): Likewise.
* attribs.c, builtins.c, c-common.c, c-decl.c, c-format.c,
c-gimplify.c, c-lex.c, c-objc-common.c, c-opts.c, c-parser.c,
c-pragma.c, c-typeck.c, calls.c, cgraph.c, coverage.c, emit-rtl.c,
fold-const.c, fortran/trans-decl.c, function.c, gcse.c,
genautomata.c, haifa-sched.c, opts.c, passes.c, regclass.c,
reload1.c, stmt.c, stor-layout.c, toplev.c, tree-cfg.c,
tree-dump.c, tree-inline.c, tree-mudflap.c, tree-optimize.c,
tree-ssa.c, tree.c, varasm.c: Adjust warning() callers.
* config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c,
config/avr/avr.c, config/bfin/bfin.c, config/c4x/c4x-c.c,
config/c4x/c4x.c, config/cris/cris.c, config/darwin-c.c,
config/darwin.c, config/darwin.h, config/h8300/h8300.c,
config/i386/cygming.h, config/i386/djgpp.h, config/i386/i386.c,
config/i386/winnt.c, config/ia64/ia64-c.c, config/ia64/ia64.c,
config/ip2k/ip2k.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c,
config/m68k/m68k.c, config/mcore/mcore.c, config/mips/mips.c,
config/mmix/mmix.c, config/ns32k/ns32k.c, config/pa/pa-hpux11.h,
config/pa/pa.c, config/rs6000/aix43.h, config/rs6000/aix51.h,
config/rs6000/aix52.h, config/rs6000/darwin.h,
config/rs6000/rs6000-c.c, config/rs6000/rs6000.c,
config/s390/s390.c, config/sh/sh.c, config/sh/sh.h,
config/sh/symbian.c, config/sol2-c.c, config/sol2.c,
config/stormy16/stormy16.c, config/v850/v850-c.c,
config/v850/v850.c, config/xtensa/xtensa.c: Adjust warning()
callers.
2005-04-23 Richard Henderson <rth@redhat.com>
PR rtl-opt/21102

View File

@ -1,3 +1,7 @@
2005-04-23 DJ Delorie <dj@redhat.com>
* misc.c: Adjust warning() callers.
2005-04-16 Laurent GUERBY <laurent@guerby.net>
PR ada/18847

View File

@ -301,7 +301,7 @@ gnat_handle_option (size_t scode, const char *arg, int value ATTRIBUTE_UNUSED)
break;
case OPT_gant:
warning ("%<-gnat%> misspelled as %<-gant%>");
warning (0, "%<-gnat%> misspelled as %<-gant%>");
/* ... fall through ... */

View File

@ -172,7 +172,7 @@ decl_attributes (tree *node, tree attributes, int flags)
if (spec == NULL)
{
warning ("%qs attribute directive ignored",
warning (0, "%qs attribute directive ignored",
IDENTIFIER_POINTER (name));
continue;
}
@ -197,7 +197,7 @@ decl_attributes (tree *node, tree attributes, int flags)
}
else
{
warning ("%qs attribute does not apply to types",
warning (0, "%qs attribute does not apply to types",
IDENTIFIER_POINTER (name));
continue;
}
@ -243,7 +243,7 @@ decl_attributes (tree *node, tree attributes, int flags)
if (TREE_CODE (*anode) != FUNCTION_TYPE
&& TREE_CODE (*anode) != METHOD_TYPE)
{
warning ("%qs attribute only applies to function types",
warning (0, "%qs attribute only applies to function types",
IDENTIFIER_POINTER (name));
continue;
}

View File

@ -351,7 +351,7 @@ c_strlen (tree src, int only_value)
runtime. */
if (offset < 0 || offset > max)
{
warning ("offset outside bounds of constant string");
warning (0, "offset outside bounds of constant string");
return 0;
}
@ -945,7 +945,7 @@ expand_builtin_prefetch (tree arglist)
/* Argument 1 must be either zero or one. */
if (INTVAL (op1) != 0 && INTVAL (op1) != 1)
{
warning ("invalid second argument to %<__builtin_prefetch%>;"
warning (0, "invalid second argument to %<__builtin_prefetch%>;"
" using zero");
op1 = const0_rtx;
}
@ -960,7 +960,7 @@ expand_builtin_prefetch (tree arglist)
/* Argument 2 must be 0, 1, 2, or 3. */
if (INTVAL (op2) < 0 || INTVAL (op2) > 3)
{
warning ("invalid third argument to %<__builtin_prefetch%>; using zero");
warning (0, "invalid third argument to %<__builtin_prefetch%>; using zero");
op2 = const0_rtx;
}
@ -4220,12 +4220,12 @@ gimplify_va_arg_expr (tree *expr_p, tree *pre_p, tree *post_p)
/* Unfortunately, this is merely undefined, rather than a constraint
violation, so we cannot make this an error. If this call is never
executed, the program is still strictly conforming. */
warning ("%qT is promoted to %qT when passed through %<...%>",
warning (0, "%qT is promoted to %qT when passed through %<...%>",
type, promoted_type);
if (! gave_help)
{
gave_help = true;
warning ("(so you should pass %qT not %qT to %<va_arg%>)",
warning (0, "(so you should pass %qT not %qT to %<va_arg%>)",
promoted_type, type);
}
@ -4365,9 +4365,9 @@ expand_builtin_frame_address (tree fndecl, tree arglist)
if (tem == NULL)
{
if (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_FRAME_ADDRESS)
warning ("unsupported argument to %<__builtin_frame_address%>");
warning (0, "unsupported argument to %<__builtin_frame_address%>");
else
warning ("unsupported argument to %<__builtin_return_address%>");
warning (0, "unsupported argument to %<__builtin_return_address%>");
return const0_rtx;
}
@ -9486,7 +9486,7 @@ fold_builtin_next_arg (tree arglist)
{
/* Evidently an out of date version of <stdarg.h>; can't validate
va_start's second argument, but can still work as intended. */
warning ("%<__builtin_next_arg%> called without an argument");
warning (0, "%<__builtin_next_arg%> called without an argument");
return true;
}
/* We use __builtin_va_start (ap, 0, 0) or __builtin_next_arg (0, 0)
@ -9521,7 +9521,7 @@ fold_builtin_next_arg (tree arglist)
argument. We just warn and set the arg to be the last
argument so that we will get wrong-code because of
it. */
warning ("second parameter of %<va_start%> not last named argument");
warning (0, "second parameter of %<va_start%> not last named argument");
}
/* We want to verify the second parameter just once before the tree
optimizers are run and then avoid keeping it in the tree,

View File

@ -913,7 +913,7 @@ overflow_warning (tree value)
{
TREE_OVERFLOW (value) = 0;
if (skip_evaluation == 0)
warning ("integer overflow in expression");
warning (0, "integer overflow in expression");
}
else if ((TREE_CODE (value) == REAL_CST
|| (TREE_CODE (value) == COMPLEX_CST
@ -922,13 +922,13 @@ overflow_warning (tree value)
{
TREE_OVERFLOW (value) = 0;
if (skip_evaluation == 0)
warning ("floating point overflow in expression");
warning (0, "floating point overflow in expression");
}
else if (TREE_CODE (value) == VECTOR_CST && TREE_OVERFLOW (value))
{
TREE_OVERFLOW (value) = 0;
if (skip_evaluation == 0)
warning ("vector overflow in expression");
warning (0, "vector overflow in expression");
}
}
@ -950,9 +950,9 @@ unsigned_conversion_warning (tree result, tree operand)
{
if (!int_fits_type_p (operand, c_common_signed_type (type)))
/* This detects cases like converting -129 or 256 to unsigned char. */
warning ("large integer implicitly truncated to unsigned type");
warning (0, "large integer implicitly truncated to unsigned type");
else if (warn_conversion)
warning ("negative integer implicitly converted to unsigned type");
warning (0, "negative integer implicitly converted to unsigned type");
}
}
@ -1010,7 +1010,7 @@ convert_and_check (tree type, tree expr)
|| !constant_fits_type_p (expr,
c_common_unsigned_type (type)))
&& skip_evaluation == 0)
warning ("overflow in implicit constant conversion");
warning (0, "overflow in implicit constant conversion");
}
else
unsigned_conversion_warning (t, expr);
@ -1146,7 +1146,7 @@ warn_for_collisions_1 (tree written, tree writer, struct tlist *list,
&& DECL_NAME (list->expr))
{
warned_ids = new_tlist (warned_ids, written, NULL_TREE);
warning ("operation on %qE may be undefined", list->expr);
warning (0, "operation on %qE may be undefined", list->expr);
}
list = list->next;
}
@ -1472,7 +1472,7 @@ check_case_bounds (tree type, tree orig_type,
if (tree_int_cst_compare (case_low, min_value) < 0
&& tree_int_cst_compare (case_high, min_value) < 0)
{
warning ("case label value is less than minimum value for type");
warning (0, "case label value is less than minimum value for type");
return false;
}
@ -1480,7 +1480,7 @@ check_case_bounds (tree type, tree orig_type,
if (tree_int_cst_compare (case_low, max_value) > 0
&& tree_int_cst_compare (case_high, max_value) > 0)
{
warning ("case label value exceeds maximum value for type");
warning (0, "case label value exceeds maximum value for type");
return false;
}
@ -1488,7 +1488,7 @@ check_case_bounds (tree type, tree orig_type,
if (tree_int_cst_compare (case_high, min_value) >= 0
&& tree_int_cst_compare (case_low, min_value) < 0)
{
warning ("lower value in case label range"
warning (0, "lower value in case label range"
" less than minimum value for type");
case_low = min_value;
}
@ -1497,7 +1497,7 @@ check_case_bounds (tree type, tree orig_type,
if (tree_int_cst_compare (case_low, max_value) <= 0
&& tree_int_cst_compare (case_high, max_value) > 0)
{
warning ("upper value in case label range"
warning (0, "upper value in case label range"
" exceeds maximum value for type");
case_high = max_value;
}
@ -2120,9 +2120,9 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr,
if (TREE_CODE (primop0) != INTEGER_CST)
{
if (val == truthvalue_false_node)
warning ("comparison is always false due to limited range of data type");
warning (0, "comparison is always false due to limited range of data type");
if (val == truthvalue_true_node)
warning ("comparison is always true due to limited range of data type");
warning (0, "comparison is always true due to limited range of data type");
}
if (val != 0)
@ -2192,7 +2192,7 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr,
&& !(TREE_CODE (primop0) == INTEGER_CST
&& !TREE_OVERFLOW (convert (c_common_signed_type (type),
primop0))))
warning ("comparison of unsigned expression >= 0 is always true");
warning (0, "comparison of unsigned expression >= 0 is always true");
value = truthvalue_true_node;
break;
@ -2201,7 +2201,7 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr,
&& !(TREE_CODE (primop0) == INTEGER_CST
&& !TREE_OVERFLOW (convert (c_common_signed_type (type),
primop0))))
warning ("comparison of unsigned expression < 0 is always false");
warning (0, "comparison of unsigned expression < 0 is always false");
value = truthvalue_false_node;
break;
@ -2381,7 +2381,7 @@ c_common_truthvalue_conversion (tree expr)
{
/* Common Ada/Pascal programmer's mistake. We always warn
about this since it is so bad. */
warning ("the address of %qD, will always evaluate as %<true%>",
warning (0, "the address of %qD, will always evaluate as %<true%>",
TREE_OPERAND (expr, 0));
return truthvalue_true_node;
}
@ -2477,7 +2477,7 @@ c_common_truthvalue_conversion (tree expr)
case MODIFY_EXPR:
if (warn_parentheses && !TREE_NO_WARNING (expr))
warning ("suggest parentheses around assignment used as truth value");
warning (0, "suggest parentheses around assignment used as truth value");
break;
default:
@ -3548,7 +3548,7 @@ c_add_case_label (splay_tree cases, tree cond, tree orig_type,
high_value = NULL_TREE;
if (low_value && high_value
&& !tree_int_cst_lt (low_value, high_value))
warning ("empty range specified");
warning (0, "empty range specified");
/* See if the case is in range of the type of the original testing
expression. If both low_value and high_value are out of range,
@ -3667,10 +3667,10 @@ match_case_to_enum_1 (tree key, tree type, tree label)
TREE_INT_CST_HIGH (key), TREE_INT_CST_LOW (key));
if (TYPE_NAME (type) == 0)
warning ("%Jcase value %qs not in enumerated type",
warning (0, "%Jcase value %qs not in enumerated type",
CASE_LABEL (label), buf);
else
warning ("%Jcase value %qs not in enumerated type %qT",
warning (0, "%Jcase value %qs not in enumerated type %qT",
CASE_LABEL (label), buf, type);
}
@ -3727,7 +3727,7 @@ c_do_switch_warnings (splay_tree cases, location_t switch_location,
default_node = splay_tree_lookup (cases, (splay_tree_key) NULL);
if (warn_switch_default && !default_node)
warning ("%Hswitch missing default case", &switch_location);
warning (0, "%Hswitch missing default case", &switch_location);
/* If the switch expression was an enumerated type, check that
exactly all enumeration literals are covered by the cases.
@ -3761,7 +3761,7 @@ c_do_switch_warnings (splay_tree cases, location_t switch_location,
{
/* Warn if there are enumerators that don't correspond to
case expressions. */
warning ("%Henumeration value %qE not handled in switch",
warning (0, "%Henumeration value %qE not handled in switch",
&switch_location, TREE_PURPOSE (chain));
}
}
@ -3957,7 +3957,7 @@ handle_packed_attribute (tree *node, tree name, tree ARG_UNUSED (args),
that changes what the typedef is typing. */
else
{
warning ("%qE attribute ignored", name);
warning (0, "%qE attribute ignored", name);
*no_add_attrs = true;
}
@ -3976,7 +3976,7 @@ handle_nocommon_attribute (tree *node, tree name,
DECL_COMMON (*node) = 0;
else
{
warning ("%qE attribute ignored", name);
warning (0, "%qE attribute ignored", name);
*no_add_attrs = true;
}
@ -3994,7 +3994,7 @@ handle_common_attribute (tree *node, tree name, tree ARG_UNUSED (args),
DECL_COMMON (*node) = 1;
else
{
warning ("%qE attribute ignored", name);
warning (0, "%qE attribute ignored", name);
*no_add_attrs = true;
}
@ -4021,7 +4021,7 @@ handle_noreturn_attribute (tree *node, tree name, tree ARG_UNUSED (args),
TYPE_READONLY (TREE_TYPE (type)), 1));
else
{
warning ("%qE attribute ignored", name);
warning (0, "%qE attribute ignored", name);
*no_add_attrs = true;
}
@ -4040,7 +4040,7 @@ handle_noinline_attribute (tree *node, tree name,
DECL_UNINLINABLE (*node) = 1;
else
{
warning ("%qE attribute ignored", name);
warning (0, "%qE attribute ignored", name);
*no_add_attrs = true;
}
@ -4063,7 +4063,7 @@ handle_always_inline_attribute (tree *node, tree name,
}
else
{
warning ("%qE attribute ignored", name);
warning (0, "%qE attribute ignored", name);
*no_add_attrs = true;
}
@ -4087,7 +4087,7 @@ handle_used_attribute (tree *pnode, tree name, tree ARG_UNUSED (args),
}
else
{
warning ("%qE attribute ignored", name);
warning (0, "%qE attribute ignored", name);
*no_add_attrs = true;
}
@ -4113,7 +4113,7 @@ handle_unused_attribute (tree *node, tree name, tree ARG_UNUSED (args),
TREE_USED (decl) = 1;
else
{
warning ("%qE attribute ignored", name);
warning (0, "%qE attribute ignored", name);
*no_add_attrs = true;
}
}
@ -4147,7 +4147,7 @@ handle_const_attribute (tree *node, tree name, tree ARG_UNUSED (args),
TREE_THIS_VOLATILE (TREE_TYPE (type))));
else
{
warning ("%qE attribute ignored", name);
warning (0, "%qE attribute ignored", name);
*no_add_attrs = true;
}
@ -4191,7 +4191,7 @@ handle_transparent_union_attribute (tree *node, tree name,
DECL_TRANSPARENT_UNION (decl) = 1;
else
{
warning ("%qE attribute ignored", name);
warning (0, "%qE attribute ignored", name);
*no_add_attrs = true;
}
@ -4219,7 +4219,7 @@ handle_constructor_attribute (tree *node, tree name,
}
else
{
warning ("%qE attribute ignored", name);
warning (0, "%qE attribute ignored", name);
*no_add_attrs = true;
}
@ -4247,7 +4247,7 @@ handle_destructor_attribute (tree *node, tree name,
}
else
{
warning ("%qE attribute ignored", name);
warning (0, "%qE attribute ignored", name);
*no_add_attrs = true;
}
@ -4266,7 +4266,7 @@ handle_mode_attribute (tree *node, tree name, tree args,
*no_add_attrs = true;
if (TREE_CODE (TREE_VALUE (args)) != IDENTIFIER_NODE)
warning ("%qE attribute ignored", name);
warning (0, "%qE attribute ignored", name);
else
{
int j;
@ -4324,9 +4324,9 @@ handle_mode_attribute (tree *node, tree name, tree args,
case MODE_VECTOR_INT:
case MODE_VECTOR_FLOAT:
warning ("specifying vector types with __attribute__ ((mode)) "
warning (0, "specifying vector types with __attribute__ ((mode)) "
"is deprecated");
warning ("use __attribute__ ((vector_size)) instead");
warning (0, "use __attribute__ ((vector_size)) instead");
valid_mode = vector_mode_valid_p (mode);
break;
@ -4591,7 +4591,7 @@ handle_alias_attribute (tree *node, tree name, tree args,
}
else
{
warning ("%qE attribute ignored", name);
warning (0, "%qE attribute ignored", name);
*no_add_attrs = true;
}
@ -4615,13 +4615,13 @@ handle_visibility_attribute (tree *node, tree name, tree args,
{
if (TREE_CODE (*node) != RECORD_TYPE && TREE_CODE (*node) != UNION_TYPE)
{
warning ("%qE attribute ignored on non-class types", name);
warning (0, "%qE attribute ignored on non-class types", name);
return NULL_TREE;
}
}
else if (decl_function_context (decl) != 0 || !TREE_PUBLIC (decl))
{
warning ("%qE attribute ignored", name);
warning (0, "%qE attribute ignored", name);
return NULL_TREE;
}
@ -4639,7 +4639,7 @@ handle_visibility_attribute (tree *node, tree name, tree args,
return NULL_TREE;
if (TREE_CODE (decl) == IDENTIFIER_NODE)
{
warning ("%qE attribute ignored on types",
warning (0, "%qE attribute ignored on types",
name);
return NULL_TREE;
}
@ -4713,7 +4713,7 @@ handle_tls_model_attribute (tree *node, tree name, tree args,
if (!DECL_THREAD_LOCAL (decl))
{
warning ("%qE attribute ignored", name);
warning (0, "%qE attribute ignored", name);
*no_add_attrs = true;
}
else
@ -4780,7 +4780,7 @@ handle_malloc_attribute (tree *node, tree name, tree ARG_UNUSED (args),
DECL_IS_MALLOC (*node) = 1;
else
{
warning ("%qE attribute ignored", name);
warning (0, "%qE attribute ignored", name);
*no_add_attrs = true;
}
@ -4798,7 +4798,7 @@ handle_returns_twice_attribute (tree *node, tree name, tree ARG_UNUSED (args),
DECL_IS_RETURNS_TWICE (*node) = 1;
else
{
warning ("%qE attribute ignored", name);
warning (0, "%qE attribute ignored", name);
*no_add_attrs = true;
}
@ -4844,7 +4844,7 @@ handle_pure_attribute (tree *node, tree name, tree ARG_UNUSED (args),
/* ??? TODO: Support types. */
else
{
warning ("%qE attribute ignored", name);
warning (0, "%qE attribute ignored", name);
*no_add_attrs = true;
}
@ -4912,9 +4912,9 @@ handle_deprecated_attribute (tree *node, tree name,
what = DECL_NAME (TYPE_NAME (type));
}
if (what)
warning ("%qE attribute ignored for %qE", name, what);
warning (0, "%qE attribute ignored for %qE", name, what);
else
warning ("%qE attribute ignored", name);
warning (0, "%qE attribute ignored", name);
}
return NULL_TREE;
@ -4938,7 +4938,7 @@ handle_vector_size_attribute (tree *node, tree name, tree args,
if (!host_integerp (size, 1))
{
warning ("%qE attribute ignored", name);
warning (0, "%qE attribute ignored", name);
return NULL_TREE;
}
@ -5100,7 +5100,7 @@ check_function_sentinel (tree attrs, tree params)
if (attr)
{
if (!params)
warning ("missing sentinel in function call");
warning (0, "missing sentinel in function call");
else
{
tree sentinel, end;
@ -5122,7 +5122,7 @@ check_function_sentinel (tree attrs, tree params)
}
if (pos > 0)
{
warning ("not enough arguments to fit a sentinel");
warning (0, "not enough arguments to fit a sentinel");
return;
}
@ -5136,7 +5136,7 @@ check_function_sentinel (tree attrs, tree params)
/* Validate the sentinel. */
if (!POINTER_TYPE_P (TREE_TYPE (TREE_VALUE (sentinel)))
|| !integer_zerop (TREE_VALUE (sentinel)))
warning ("missing sentinel in function call");
warning (0, "missing sentinel in function call");
}
}
}
@ -5178,7 +5178,7 @@ check_nonnull_arg (void * ARG_UNUSED (ctx), tree param,
return;
if (integer_zerop (param))
warning ("null argument where non-null required (argument %lu)",
warning (0, "null argument where non-null required (argument %lu)",
(unsigned long) param_num);
}
@ -5209,7 +5209,7 @@ handle_nothrow_attribute (tree *node, tree name, tree ARG_UNUSED (args),
/* ??? TODO: Support types. */
else
{
warning ("%qE attribute ignored", name);
warning (0, "%qE attribute ignored", name);
*no_add_attrs = true;
}
@ -5232,7 +5232,7 @@ handle_cleanup_attribute (tree *node, tree name, tree args,
we'd be missing too much, since we do have attribute constructor. */
if (TREE_CODE (decl) != VAR_DECL || TREE_STATIC (decl))
{
warning ("%qE attribute ignored", name);
warning (0, "%qE attribute ignored", name);
*no_add_attrs = true;
return NULL_TREE;
}
@ -5271,7 +5271,7 @@ handle_warn_unused_result_attribute (tree *node, tree name,
/* Ignore the attribute for functions not returning any value. */
if (VOID_TYPE_P (TREE_TYPE (*node)))
{
warning ("%qE attribute ignored", name);
warning (0, "%qE attribute ignored", name);
*no_add_attrs = true;
}
@ -5288,7 +5288,7 @@ handle_sentinel_attribute (tree *node, tree name, tree args,
if (!params)
{
warning ("%qE attribute requires prototypes with named arguments", name);
warning (0, "%qE attribute requires prototypes with named arguments", name);
*no_add_attrs = true;
}
else
@ -5298,7 +5298,7 @@ handle_sentinel_attribute (tree *node, tree name, tree args,
if (VOID_TYPE_P (TREE_VALUE (params)))
{
warning ("%qE attribute only applies to variadic functions", name);
warning (0, "%qE attribute only applies to variadic functions", name);
*no_add_attrs = true;
}
}
@ -5309,14 +5309,14 @@ handle_sentinel_attribute (tree *node, tree name, tree args,
if (TREE_CODE (position) != INTEGER_CST)
{
warning ("requested position is not an integer constant");
warning (0, "requested position is not an integer constant");
*no_add_attrs = true;
}
else
{
if (tree_int_cst_lt (position, integer_zero_node))
{
warning ("requested position is less than zero");
warning (0, "requested position is less than zero");
*no_add_attrs = true;
}
}
@ -5618,11 +5618,11 @@ c_warn_unused_result (tree *top_p)
if (lookup_attribute ("warn_unused_result", TYPE_ATTRIBUTES (ftype)))
{
if (fdecl)
warning ("%Hignoring return value of %qD, "
warning (0, "%Hignoring return value of %qD, "
"declared with attribute warn_unused_result",
EXPR_LOCUS (t), fdecl);
else
warning ("%Hignoring return value of function "
warning (0, "%Hignoring return value of function "
"declared with attribute warn_unused_result",
EXPR_LOCUS (t));
}

View File

@ -527,7 +527,7 @@ c_finish_incomplete_decl (tree decl)
&& !DECL_EXTERNAL (decl)
&& TYPE_DOMAIN (type) == 0)
{
warning ("%Jarray %qD assumed to have one element", decl, decl);
warning (0, "%Jarray %qD assumed to have one element", decl, decl);
complete_array_type (&TREE_TYPE (decl), NULL_TREE, true);
@ -732,9 +732,9 @@ pop_scope (void)
else if (!TREE_USED (p) && warn_unused_label)
{
if (DECL_INITIAL (p))
warning ("%Jlabel %qD defined but not used", p, p);
warning (0, "%Jlabel %qD defined but not used", p, p);
else
warning ("%Jlabel %qD declared but not defined", p, p);
warning (0, "%Jlabel %qD declared but not defined", p, p);
}
/* Labels go in BLOCK_VARS. */
TREE_CHAIN (p) = BLOCK_VARS (block);
@ -783,7 +783,7 @@ pop_scope (void)
&& !DECL_ARTIFICIAL (p)
&& scope != file_scope
&& scope != external_scope)
warning ("%Junused variable %qD", p, p);
warning (0, "%Junused variable %qD", p, p);
if (b->inner_comp)
{
@ -1091,7 +1091,7 @@ validate_proto_after_old_defn (tree newdecl, tree newtype, tree oldtype)
/* If we get here, no errors were found, but do issue a warning
for this poor-style construct. */
warning ("%Jprototype for %qD follows non-prototype definition",
warning (0, "%Jprototype for %qD follows non-prototype definition",
newdecl, newdecl);
return true;
#undef END_OF_ARGLIST
@ -1152,10 +1152,10 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
locate_old_decl (olddecl, error);
}
else if (TREE_PUBLIC (newdecl))
warning ("%Jbuilt-in function %qD declared as non-function",
warning (0, "%Jbuilt-in function %qD declared as non-function",
newdecl, newdecl);
else if (warn_shadow)
warning ("%Jdeclaration of %qD shadows a built-in function",
warning (0, "%Jdeclaration of %qD shadows a built-in function",
newdecl, newdecl);
return false;
}
@ -1185,7 +1185,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
/* If types don't match for a built-in, throw away the
built-in. No point in calling locate_old_decl here, it
won't print anything. */
warning ("%Jconflicting types for built-in function %qD",
warning (0, "%Jconflicting types for built-in function %qD",
newdecl, newdecl);
return false;
}
@ -1271,7 +1271,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
&& !TYPE_ARG_TYPES (TREE_TYPE (newdecl)))))
{
if (warn_shadow)
warning ("%Jdeclaration of %qD shadows a built-in function",
warning (0, "%Jdeclaration of %qD shadows a built-in function",
newdecl, newdecl);
/* Discard the old built-in function. */
return false;
@ -1368,7 +1368,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
}
else if (warn_traditional)
{
warning ("%Jnon-static declaration of %qD follows "
warning (0, "%Jnon-static declaration of %qD follows "
"static declaration", newdecl, newdecl);
warned = true;
}
@ -1421,7 +1421,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
}
else if (warn_traditional)
{
warning ("%Jnon-static declaration of %qD follows "
warning (0, "%Jnon-static declaration of %qD follows "
"static declaration", newdecl, newdecl);
warned = true;
}
@ -1470,7 +1470,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
if (DECL_VISIBILITY_SPECIFIED (newdecl) && DECL_VISIBILITY_SPECIFIED (olddecl)
&& DECL_VISIBILITY (newdecl) != DECL_VISIBILITY (olddecl))
{
warning ("%Jredeclaration of %qD with different visibility "
warning (0, "%Jredeclaration of %qD with different visibility "
"(old visibility preserved)", newdecl, newdecl);
warned = true;
}
@ -1481,14 +1481,14 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
if (DECL_DECLARED_INLINE_P (newdecl)
&& lookup_attribute ("noinline", DECL_ATTRIBUTES (olddecl)))
{
warning ("%Jinline declaration of %qD follows "
warning (0, "%Jinline declaration of %qD follows "
"declaration with attribute noinline", newdecl, newdecl);
warned = true;
}
else if (DECL_DECLARED_INLINE_P (olddecl)
&& lookup_attribute ("noinline", DECL_ATTRIBUTES (newdecl)))
{
warning ("%Jdeclaration of %qD with attribute noinline follows "
warning (0, "%Jdeclaration of %qD with attribute noinline follows "
"inline declaration ", newdecl, newdecl);
warned = true;
}
@ -1503,13 +1503,13 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
{
if (TREE_USED (olddecl))
{
warning ("%J%qD declared inline after being called",
warning (0, "%J%qD declared inline after being called",
olddecl, olddecl);
warned = true;
}
else if (DECL_INITIAL (olddecl))
{
warning ("%J%qD declared inline after its definition",
warning (0, "%J%qD declared inline after its definition",
olddecl, olddecl);
warned = true;
}
@ -1553,13 +1553,13 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
&& !(TREE_CODE (newdecl) == PARM_DECL
&& TREE_ASM_WRITTEN (olddecl) && !TREE_ASM_WRITTEN (newdecl)))
{
warning ("%Jredundant redeclaration of %qD", newdecl, newdecl);
warning (0, "%Jredundant redeclaration of %qD", newdecl, newdecl);
warned = true;
}
/* Report location of previous decl/defn in a consistent manner. */
if (warned || pedwarned)
locate_old_decl (olddecl, pedwarned ? pedwarn : warning);
locate_old_decl (olddecl, pedwarned ? pedwarn : warning0);
return retval;
}
@ -1865,28 +1865,28 @@ warn_if_shadowing (tree new_decl)
if (old_decl == error_mark_node)
{
warning ("%Jdeclaration of %qD shadows previous non-variable",
warning (0, "%Jdeclaration of %qD shadows previous non-variable",
new_decl, new_decl);
break;
}
else if (TREE_CODE (old_decl) == PARM_DECL)
warning ("%Jdeclaration of %qD shadows a parameter",
warning (0, "%Jdeclaration of %qD shadows a parameter",
new_decl, new_decl);
else if (DECL_FILE_SCOPE_P (old_decl))
warning ("%Jdeclaration of %qD shadows a global declaration",
warning (0, "%Jdeclaration of %qD shadows a global declaration",
new_decl, new_decl);
else if (TREE_CODE (old_decl) == FUNCTION_DECL
&& DECL_BUILT_IN (old_decl))
{
warning ("%Jdeclaration of %qD shadows a built-in function",
warning (0, "%Jdeclaration of %qD shadows a built-in function",
new_decl, new_decl);
break;
}
else
warning ("%Jdeclaration of %qD shadows a previous local",
warning (0, "%Jdeclaration of %qD shadows a previous local",
new_decl, new_decl);
warning ("%Jshadowed declaration is here", old_decl);
warning (0, "%Jshadowed declaration is here", old_decl);
break;
}
@ -2046,7 +2046,7 @@ pushdecl (tree x)
if (warn_nested_externs
&& scope != file_scope
&& !DECL_IN_SYSTEM_HEADER (x))
warning ("nested extern declaration of %qD", x);
warning (0, "nested extern declaration of %qD", x);
while (b && !B_IN_EXTERNAL_SCOPE (b))
{
@ -2201,7 +2201,7 @@ implicit_decl_warning (tree id, tree olddecl)
switch (mesg_implicit_function_declaration)
{
case 0: return;
case 1: diag = warning; break;
case 1: diag = warning0; break;
case 2: diag = error; break;
default: gcc_unreachable ();
}
@ -2267,7 +2267,7 @@ implicitly_declare (tree functionid)
(TREE_TYPE (decl)));
if (!comptypes (newtype, TREE_TYPE (decl)))
{
warning ("incompatible implicit declaration of built-in"
warning (0, "incompatible implicit declaration of built-in"
" function %qD", decl);
newtype = TREE_TYPE (decl);
}
@ -2482,7 +2482,7 @@ define_label (location_t location, tree name)
}
if (warn_traditional && !in_system_header && lookup_name (name))
warning ("%Htraditional C lacks a separate namespace for labels, "
warning (0, "%Htraditional C lacks a separate namespace for labels, "
"identifier %qE conflicts", &location, name);
nlist_se = XOBNEW (&parser_obstack, struct c_label_list);
@ -2844,13 +2844,13 @@ shadow_tag_warned (const struct c_declspecs *declspecs, int warned)
if (!warned && !in_system_header && declspecs->storage_class != csc_none)
{
warning ("useless storage class specifier in empty declaration");
warning (0, "useless storage class specifier in empty declaration");
warned = 2;
}
if (!warned && !in_system_header && declspecs->thread_p)
{
warning ("useless %<__thread%> in empty declaration");
warning (0, "useless %<__thread%> in empty declaration");
warned = 2;
}
@ -2858,7 +2858,7 @@ shadow_tag_warned (const struct c_declspecs *declspecs, int warned)
|| declspecs->volatile_p
|| declspecs->restrict_p))
{
warning ("useless type qualifier in empty declaration");
warning (0, "useless type qualifier in empty declaration");
warned = 2;
}
@ -2937,7 +2937,7 @@ build_array_declarator (tree expr, struct c_declspecs *quals, bool static_p,
pedwarn ("ISO C90 does not support %<[*]%> array declarators");
}
if (vla_unspec_p)
warning ("GCC does not yet properly implement %<[*]%> array declarators");
warning (0, "GCC does not yet properly implement %<[*]%> array declarators");
return declarator;
}
@ -3015,7 +3015,7 @@ start_decl (struct c_declarator *declarator, struct c_declspecs *declspecs,
if (warn_main > 0 && TREE_CODE (decl) != FUNCTION_DECL
&& MAIN_NAME_P (DECL_NAME (decl)))
warning ("%J%qD is usually a function", decl, decl);
warning (0, "%J%qD is usually a function", decl, decl);
if (initialized)
/* Is it valid for this decl to have an initializer at all?
@ -3136,7 +3136,7 @@ start_decl (struct c_declarator *declarator, struct c_declspecs *declspecs,
&& DECL_DECLARED_INLINE_P (decl)
&& DECL_UNINLINABLE (decl)
&& lookup_attribute ("noinline", DECL_ATTRIBUTES (decl)))
warning ("%Jinline function %qD given attribute noinline", decl, decl);
warning (0, "%Jinline function %qD given attribute noinline", decl, decl);
/* Add this decl to the current scope.
TEM may equal DECL or it may be a previous decl of the same name. */
@ -3307,7 +3307,7 @@ finish_decl (tree decl, tree init, tree asmspec_tree)
&& TREE_CODE (decl) == VAR_DECL
&& !C_DECL_REGISTER (decl)
&& !TREE_STATIC (decl))
warning ("%Jignoring asm-specifier for non-static local "
warning (0, "%Jignoring asm-specifier for non-static local "
"variable %qD", decl, decl);
else if (C_DECL_REGISTER (decl))
change_decl_assembler_name (decl, get_identifier (asmspec));
@ -3652,7 +3652,7 @@ check_bitfield_type_and_width (tree *type, tree *width, const char *orig_name)
if (!lt
|| w < min_precision (lt->enum_min, TYPE_UNSIGNED (*type))
|| w < min_precision (lt->enum_max, TYPE_UNSIGNED (*type)))
warning ("%qs is narrower than values of its type", name);
warning (0, "%qs is narrower than values of its type", name);
}
}
@ -3870,7 +3870,7 @@ grokdeclarator (const struct c_declarator *declarator,
{
/* 'extern' with initialization is invalid if not at file scope. */
if (current_scope == file_scope)
warning ("%qs initialized and declared %<extern%>", name);
warning (0, "%qs initialized and declared %<extern%>", name);
else
error ("%qs has both %<extern%> and initializer", name);
}
@ -4183,7 +4183,7 @@ grokdeclarator (const struct c_declarator *declarator,
if (VOID_TYPE_P (type) && really_funcdef)
pedwarn ("function definition has qualified void return type");
else if (warn_return_type)
warning ("type qualifiers ignored on function return type");
warning (0, "type qualifiers ignored on function return type");
type = c_build_qualified_type (type, type_quals);
}
@ -4344,7 +4344,7 @@ grokdeclarator (const struct c_declarator *declarator,
/* We don't yet implement attributes in this context. */
if (array_ptr_attrs != NULL_TREE)
warning ("attributes in parameter array declarator ignored");
warning (0, "attributes in parameter array declarator ignored");
size_varies = 0;
}
@ -4448,7 +4448,7 @@ grokdeclarator (const struct c_declarator *declarator,
that the function does not return. */
if ((type_quals & TYPE_QUAL_VOLATILE)
&& !VOID_TYPE_P (TREE_TYPE (TREE_TYPE (decl))))
warning ("%<noreturn%> function returns non-void value");
warning (0, "%<noreturn%> function returns non-void value");
/* Every function declaration is an external reference
(DECL_EXTERNAL) except for those which are not at file
@ -4626,7 +4626,7 @@ grokparms (struct c_arg_info *arg_info, bool funcdef_flag)
if (warn_strict_prototypes && arg_types == 0 && !funcdef_flag
&& !in_system_header)
warning ("function declaration isn%'t a prototype");
warning (0, "function declaration isn%'t a prototype");
if (arg_types == error_mark_node)
return 0; /* don't set TYPE_ARG_TYPES in this case */
@ -4679,10 +4679,10 @@ grokparms (struct c_arg_info *arg_info, bool funcdef_flag)
else if (VOID_TYPE_P (type))
{
if (DECL_NAME (parm))
warning ("%Jparameter %u (%qD) has void type",
warning (0, "%Jparameter %u (%qD) has void type",
parm, parmno, parm);
else
warning ("%Jparameter %u has void type",
warning (0, "%Jparameter %u has void type",
parm, parmno);
}
}
@ -4817,16 +4817,16 @@ get_parm_info (bool ellipsis)
{
if (b->id)
/* The %s will be one of 'struct', 'union', or 'enum'. */
warning ("%<%s %E%> declared inside parameter list",
warning (0, "%<%s %E%> declared inside parameter list",
keyword, b->id);
else
/* The %s will be one of 'struct', 'union', or 'enum'. */
warning ("anonymous %s declared inside parameter list",
warning (0, "anonymous %s declared inside parameter list",
keyword);
if (!explained_incomplete_types)
{
warning ("its scope is only this definition or declaration,"
warning (0, "its scope is only this definition or declaration,"
" which is probably not what you want");
explained_incomplete_types = true;
}
@ -5332,7 +5332,7 @@ finish_struct (tree t, tree fieldlist, tree attributes)
&& TYPE_MODE (t) != DECL_MODE (TYPE_FIELDS (t)))
{
TYPE_TRANSPARENT_UNION (t) = 0;
warning ("union cannot be made transparent");
warning (0, "union cannot be made transparent");
}
/* If this structure or union completes the type of any previous
@ -5473,7 +5473,7 @@ finish_enum (tree enumtype, tree values, tree attributes)
tem = c_common_type_for_size (precision, unsign);
if (tem == NULL)
{
warning ("enumeration values exceed range of largest integer");
warning (0, "enumeration values exceed range of largest integer");
tem = long_long_integer_type_node;
}
}
@ -5693,7 +5693,7 @@ start_function (struct c_declspecs *declspecs, struct c_declarator *declarator,
if (DECL_DECLARED_INLINE_P (decl1)
&& DECL_UNINLINABLE (decl1)
&& lookup_attribute ("noinline", DECL_ATTRIBUTES (decl1)))
warning ("%Jinline function %qD given attribute noinline", decl1, decl1);
warning (0, "%Jinline function %qD given attribute noinline", decl1, decl1);
announce_function (decl1);
@ -5731,14 +5731,14 @@ start_function (struct c_declspecs *declspecs, struct c_declarator *declarator,
&& old_decl != error_mark_node
&& TYPE_ARG_TYPES (TREE_TYPE (decl1)) == 0
&& C_DECL_ISNT_PROTOTYPE (old_decl))
warning ("function declaration isn%'t a prototype");
warning (0, "function declaration isn%'t a prototype");
/* Optionally warn of any global def with no previous prototype. */
else if (warn_missing_prototypes
&& old_decl != error_mark_node
&& TREE_PUBLIC (decl1)
&& !MAIN_NAME_P (DECL_NAME (decl1))
&& C_DECL_ISNT_PROTOTYPE (old_decl))
warning ("%Jno previous prototype for %qD", decl1, decl1);
warning (0, "%Jno previous prototype for %qD", decl1, decl1);
/* Optionally warn of any def with no previous prototype
if the function has already been used. */
else if (warn_missing_prototypes
@ -5746,14 +5746,14 @@ start_function (struct c_declspecs *declspecs, struct c_declarator *declarator,
&& old_decl != error_mark_node
&& TREE_USED (old_decl)
&& TYPE_ARG_TYPES (TREE_TYPE (old_decl)) == 0)
warning ("%J%qD was used with no prototype before its definition",
warning (0, "%J%qD was used with no prototype before its definition",
decl1, decl1);
/* Optionally warn of any global def with no previous declaration. */
else if (warn_missing_declarations
&& TREE_PUBLIC (decl1)
&& old_decl == 0
&& !MAIN_NAME_P (DECL_NAME (decl1)))
warning ("%Jno previous declaration for %qD", decl1, decl1);
warning (0, "%Jno previous declaration for %qD", decl1, decl1);
/* Optionally warn of any def with no previous declaration
if the function has already been used. */
else if (warn_missing_declarations
@ -5761,7 +5761,7 @@ start_function (struct c_declspecs *declspecs, struct c_declarator *declarator,
&& old_decl != error_mark_node
&& TREE_USED (old_decl)
&& C_DECL_IMPLICIT (old_decl))
warning ("%J%qD was used with no declaration before its definition",
warning (0, "%J%qD was used with no declaration before its definition",
decl1, decl1);
/* This is a definition, not a reference.
@ -5899,7 +5899,7 @@ store_parm_decls_newstyle (tree fndecl, const struct c_arg_info *arg_info)
its parameter list). */
else if (warn_traditional && !in_system_header && !current_function_scope
&& arg_info->types != error_mark_node)
warning ("%Jtraditional C rejects ISO C style function definitions",
warning (0, "%Jtraditional C rejects ISO C style function definitions",
fndecl);
/* Now make all the parameter declarations visible in the function body.
@ -5951,7 +5951,7 @@ store_parm_decls_oldstyle (tree fndecl, const struct c_arg_info *arg_info)
#endif
if (warn_old_style_definition && !in_system_header)
warning ("%Jold-style function definition", fndecl);
warning (0, "%Jold-style function definition", fndecl);
/* Match each formal parameter name with its declaration. Save each
decl in the appropriate TREE_PURPOSE slot of the parmids chain. */
@ -6000,7 +6000,7 @@ store_parm_decls_oldstyle (tree fndecl, const struct c_arg_info *arg_info)
if (flag_isoc99)
pedwarn ("%Jtype of %qD defaults to %<int%>", decl, decl);
else if (extra_warnings)
warning ("%Jtype of %qD defaults to %<int%>", decl, decl);
warning (0, "%Jtype of %qD defaults to %<int%>", decl, decl);
}
TREE_PURPOSE (parm) = decl;
@ -6332,14 +6332,14 @@ finish_function (void)
/* Normally, with -Wreturn-type, flow will complain. Unless we're an
inline function, as we might never be compiled separately. */
&& DECL_INLINE (fndecl))
warning ("no return statement in function returning non-void");
warning (0, "no return statement in function returning non-void");
/* With just -Wextra, complain only if function returns both with
and without a value. */
if (extra_warnings
&& current_function_returns_value
&& current_function_returns_null)
warning ("this function may return with or without a value");
warning (0, "this function may return with or without a value");
/* Store the end of the function, so that we get good line number
info for the epilogue. */
@ -7087,7 +7087,7 @@ declspecs_add_scspec (struct c_declspecs *specs, tree scspec)
&& C_IS_RESERVED_WORD (scspec));
i = C_RID_CODE (scspec);
if (extra_warnings && specs->non_sc_seen_p)
warning ("%qE is not at beginning of declaration", scspec);
warning (0, "%qE is not at beginning of declaration", scspec);
switch (i)
{
case RID_INLINE:

View File

@ -194,7 +194,7 @@ decode_format_attr (tree args, function_format_info *info, int validated_p)
if (info->format_type == format_type_error)
{
gcc_assert (!validated_p);
warning ("%qE is an unrecognized format function type",
warning (0, "%qE is an unrecognized format function type",
format_type_id);
return false;
}
@ -833,7 +833,7 @@ check_function_format (tree attrs, tree params)
break;
}
if (args != 0)
warning ("function might be possible candidate for %qs format attribute",
warning (0, "function might be possible candidate for %qs format attribute",
format_types[info.format_type].name);
}
}
@ -924,7 +924,7 @@ maybe_read_dollar_number (const char **format,
{
if (dollar_needed)
{
warning ("missing $ operand number in format");
warning (0, "missing $ operand number in format");
return -1;
}
else
@ -945,7 +945,7 @@ maybe_read_dollar_number (const char **format,
{
if (dollar_needed)
{
warning ("missing $ operand number in format");
warning (0, "missing $ operand number in format");
return -1;
}
else
@ -954,14 +954,14 @@ maybe_read_dollar_number (const char **format,
*format = fcp + 1;
if (pedantic && !dollar_format_warned)
{
warning ("%s does not support %%n$ operand number formats",
warning (0, "%s does not support %%n$ operand number formats",
C_STD_NAME (STD_EXT));
dollar_format_warned = 1;
}
if (overflow_flag || argnum == 0
|| (dollar_first_arg_num && argnum > dollar_arguments_count))
{
warning ("operand number out of range in format");
warning (0, "operand number out of range in format");
return -1;
}
if (argnum > dollar_max_arg_used)
@ -984,7 +984,7 @@ maybe_read_dollar_number (const char **format,
&& dollar_arguments_used[argnum - 1] == 1)
{
dollar_arguments_used[argnum - 1] = 2;
warning ("format argument %d used more than once in %s format",
warning (0, "format argument %d used more than once in %s format",
argnum, fki->name);
}
else
@ -1016,7 +1016,7 @@ avoid_dollar_number (const char *format)
format++;
if (*format == '$')
{
warning ("$ operand number used after format without operand number");
warning (0, "$ operand number used after format without operand number");
return true;
}
return false;
@ -1046,7 +1046,7 @@ finish_dollar_format_checking (format_check_results *res, int pointer_gap_ok)
|| dollar_arguments_pointer_p[i]))
found_pointer_gap = true;
else
warning ("format argument %d unused before used argument %d in $-style format",
warning (0, "format argument %d unused before used argument %d in $-style format",
i + 1, dollar_max_arg_used);
}
}
@ -1141,7 +1141,7 @@ check_format_info (function_format_info *info, tree params)
/* For strftime-like formats, warn for not checking the format
string; but there are no arguments to check. */
if (warn_format_nonliteral)
warning ("format not a string literal, format string not checked");
warning (0, "format not a string literal, format string not checked");
}
else if (info->first_arg_num != 0)
{
@ -1155,9 +1155,9 @@ check_format_info (function_format_info *info, tree params)
++arg_num;
}
if (params == 0 && (warn_format_nonliteral || warn_format_security))
warning ("format not a string literal and no format arguments");
warning (0, "format not a string literal and no format arguments");
else if (warn_format_nonliteral)
warning ("format not a string literal, argument types not checked");
warning (0, "format not a string literal, argument types not checked");
}
}
@ -1170,20 +1170,20 @@ check_format_info (function_format_info *info, tree params)
case of extra format arguments. */
if (res.number_extra_args > 0 && res.number_non_literal == 0
&& res.number_other == 0 && warn_format_extra_args)
warning ("too many arguments for format");
warning (0, "too many arguments for format");
if (res.number_dollar_extra_args > 0 && res.number_non_literal == 0
&& res.number_other == 0 && warn_format_extra_args)
warning ("unused arguments in $-style format");
warning (0, "unused arguments in $-style format");
if (res.number_empty > 0 && res.number_non_literal == 0
&& res.number_other == 0 && warn_format_zero_length)
warning ("zero-length %s format string",
warning (0, "zero-length %s format string",
format_types[info->format_type].name);
if (res.number_wide > 0)
warning ("format is a wide character string");
warning (0, "format is a wide character string");
if (res.number_unterminated > 0)
warning ("unterminated format string");
warning (0, "unterminated format string");
}
/* Callback from check_function_arguments_recurse to check a
@ -1393,7 +1393,7 @@ check_format_info_main (format_check_results *res,
if (*format_chars == 0)
{
if (format_chars - orig_format_chars != format_length)
warning ("embedded %<\\0%> in format");
warning (0, "embedded %<\\0%> in format");
if (info->first_arg_num != 0 && params != 0
&& has_operand_number <= 0)
{
@ -1408,7 +1408,7 @@ check_format_info_main (format_check_results *res,
continue;
if (*format_chars == 0)
{
warning ("spurious trailing %<%%%> in format");
warning (0, "spurious trailing %<%%%> in format");
continue;
}
if (*format_chars == '%')
@ -1452,7 +1452,7 @@ check_format_info_main (format_check_results *res,
*format_chars, NULL);
if (strchr (flag_chars, *format_chars) != 0)
{
warning ("repeated %s in format", _(s->name));
warning (0, "repeated %s in format", _(s->name));
}
else
{
@ -1465,7 +1465,7 @@ check_format_info_main (format_check_results *res,
++format_chars;
if (*format_chars == 0)
{
warning ("missing fill character at end of strfmon format");
warning (0, "missing fill character at end of strfmon format");
return;
}
}
@ -1509,7 +1509,7 @@ check_format_info_main (format_check_results *res,
{
if (params == 0)
{
warning ("too few arguments for format");
warning (0, "too few arguments for format");
return;
}
cur_param = TREE_VALUE (params);
@ -1550,7 +1550,7 @@ check_format_info_main (format_check_results *res,
}
if (found_width && !non_zero_width_char &&
(fki->flags & (int) FMT_FLAG_ZERO_WIDTH_BAD))
warning ("zero width in %s format", fki->name);
warning (0, "zero width in %s format", fki->name);
if (found_width)
{
i = strlen (flag_chars);
@ -1568,7 +1568,7 @@ check_format_info_main (format_check_results *res,
flag_chars[i++] = fki->left_precision_char;
flag_chars[i] = 0;
if (!ISDIGIT (*format_chars))
warning ("empty left precision in %s format", fki->name);
warning (0, "empty left precision in %s format", fki->name);
while (ISDIGIT (*format_chars))
++format_chars;
}
@ -1611,7 +1611,7 @@ check_format_info_main (format_check_results *res,
{
if (params == 0)
{
warning ("too few arguments for format");
warning (0, "too few arguments for format");
return;
}
cur_param = TREE_VALUE (params);
@ -1641,7 +1641,7 @@ check_format_info_main (format_check_results *res,
{
if (!(fki->flags & (int) FMT_FLAG_EMPTY_PREC_OK)
&& !ISDIGIT (*format_chars))
warning ("empty precision in %s format", fki->name);
warning (0, "empty precision in %s format", fki->name);
while (ISDIGIT (*format_chars))
++format_chars;
}
@ -1680,7 +1680,7 @@ check_format_info_main (format_check_results *res,
{
/* Warn if the length modifier is non-standard. */
if (ADJ_STD (length_chars_std) > C_STD_VER)
warning ("%s does not support the %qs %s length modifier",
warning (0, "%s does not support the %qs %s length modifier",
C_STD_NAME (length_chars_std), length_chars,
fki->name);
}
@ -1696,7 +1696,7 @@ check_format_info_main (format_check_results *res,
{
const format_flag_spec *s = get_flag_spec (flag_specs,
*format_chars, NULL);
warning ("repeated %s in format", _(s->name));
warning (0, "repeated %s in format", _(s->name));
}
else
{
@ -1730,7 +1730,7 @@ check_format_info_main (format_check_results *res,
|| (!(fki->flags & (int) FMT_FLAG_FANCY_PERCENT_OK)
&& format_char == '%'))
{
warning ("conversion lacks type at end of format");
warning (0, "conversion lacks type at end of format");
continue;
}
format_chars++;
@ -1741,17 +1741,17 @@ check_format_info_main (format_check_results *res,
if (fci->format_chars == 0)
{
if (ISGRAPH (format_char))
warning ("unknown conversion type character %qc in format",
warning (0, "unknown conversion type character %qc in format",
format_char);
else
warning ("unknown conversion type character 0x%x in format",
warning (0, "unknown conversion type character 0x%x in format",
format_char);
continue;
}
if (pedantic)
{
if (ADJ_STD (fci->std) > C_STD_VER)
warning ("%s does not support the %<%%%c%> %s format",
warning (0, "%s does not support the %<%%%c%> %s format",
C_STD_NAME (fci->std), format_char, fki->name);
}
@ -1767,7 +1767,7 @@ check_format_info_main (format_check_results *res,
continue;
if (strchr (fci->flag_chars, flag_chars[i]) == 0)
{
warning ("%s used with %<%%%c%> %s format",
warning (0, "%s used with %<%%%c%> %s format",
_(s->name), format_char, fki->name);
d++;
continue;
@ -1776,7 +1776,7 @@ check_format_info_main (format_check_results *res,
{
const format_flag_spec *t;
if (ADJ_STD (s->std) > C_STD_VER)
warning ("%s does not support %s",
warning (0, "%s does not support %s",
C_STD_NAME (s->std), _(s->long_name));
t = get_flag_spec (flag_specs, flag_chars[i], fci->flags2);
if (t != NULL && ADJ_STD (t->std) > ADJ_STD (s->std))
@ -1785,7 +1785,7 @@ check_format_info_main (format_check_results *res,
? t->long_name
: s->long_name);
if (ADJ_STD (t->std) > C_STD_VER)
warning ("%s does not support %s with the %<%%%c%> %s format",
warning (0, "%s does not support %s with the %<%%%c%> %s format",
C_STD_NAME (t->std), _(long_name),
format_char, fki->name);
}
@ -1818,21 +1818,21 @@ check_format_info_main (format_check_results *res,
if (bad_flag_pairs[i].ignored)
{
if (bad_flag_pairs[i].predicate != 0)
warning ("%s ignored with %s and %<%%%c%> %s format",
warning (0, "%s ignored with %s and %<%%%c%> %s format",
_(s->name), _(t->name), format_char,
fki->name);
else
warning ("%s ignored with %s in %s format",
warning (0, "%s ignored with %s in %s format",
_(s->name), _(t->name), fki->name);
}
else
{
if (bad_flag_pairs[i].predicate != 0)
warning ("use of %s and %s together with %<%%%c%> %s format",
warning (0, "use of %s and %s together with %<%%%c%> %s format",
_(s->name), _(t->name), format_char,
fki->name);
else
warning ("use of %s and %s together in %s format",
warning (0, "use of %s and %s together in %s format",
_(s->name), _(t->name), fki->name);
}
}
@ -1851,10 +1851,10 @@ check_format_info_main (format_check_results *res,
else if (strchr (fci->flags2, '2') != 0)
y2k_level = 2;
if (y2k_level == 3)
warning ("%<%%%c%> yields only last 2 digits of year in some locales",
warning (0, "%<%%%c%> yields only last 2 digits of year in some locales",
format_char);
else if (y2k_level == 2)
warning ("%<%%%c%> yields only last 2 digits of year", format_char);
warning (0, "%<%%%c%> yields only last 2 digits of year", format_char);
}
if (strchr (fci->flags2, '[') != 0)
@ -1870,7 +1870,7 @@ check_format_info_main (format_check_results *res,
++format_chars;
if (*format_chars != ']')
/* The end of the format string was reached. */
warning ("no closing %<]%> for %<%%[%> format");
warning (0, "no closing %<]%> for %<%%[%> format");
}
wanted_type = 0;
@ -1883,14 +1883,14 @@ check_format_info_main (format_check_results *res,
wanted_type_std = fci->types[length_chars_val].std;
if (wanted_type == 0)
{
warning ("use of %qs length modifier with %qc type character",
warning (0, "use of %qs length modifier with %qc type character",
length_chars, format_char);
/* Heuristic: skip one argument when an invalid length/type
combination is encountered. */
arg_num++;
if (params == 0)
{
warning ("too few arguments for format");
warning (0, "too few arguments for format");
return;
}
params = TREE_CHAIN (params);
@ -1904,7 +1904,7 @@ check_format_info_main (format_check_results *res,
&& ADJ_STD (wanted_type_std) > ADJ_STD (fci->std))
{
if (ADJ_STD (wanted_type_std) > C_STD_VER)
warning ("%s does not support the %<%%%s%c%> %s format",
warning (0, "%s does not support the %<%%%s%c%> %s format",
C_STD_NAME (wanted_type_std), length_chars,
format_char, fki->name);
}
@ -1921,9 +1921,9 @@ check_format_info_main (format_check_results *res,
if (main_arg_num != 0)
{
if (suppressed)
warning ("operand number specified with suppressed assignment");
warning (0, "operand number specified with suppressed assignment");
else
warning ("operand number specified for format taking no argument");
warning (0, "operand number specified for format taking no argument");
}
}
else
@ -1940,7 +1940,7 @@ check_format_info_main (format_check_results *res,
++arg_num;
if (has_operand_number > 0)
{
warning ("missing $ operand number in format");
warning (0, "missing $ operand number in format");
return;
}
else
@ -1952,7 +1952,7 @@ check_format_info_main (format_check_results *res,
{
if (params == 0)
{
warning ("too few arguments for format");
warning (0, "too few arguments for format");
return;
}
@ -2065,7 +2065,7 @@ check_format_types (format_wanted_type *types, const char *format_start,
&& i == 0
&& cur_param != 0
&& integer_zerop (cur_param))
warning ("writing through null pointer (argument %d)",
warning (0, "writing through null pointer (argument %d)",
arg_num);
/* Check for reading through a NULL pointer. */
@ -2073,7 +2073,7 @@ check_format_types (format_wanted_type *types, const char *format_start,
&& i == 0
&& cur_param != 0
&& integer_zerop (cur_param))
warning ("reading through null pointer (argument %d)",
warning (0, "reading through null pointer (argument %d)",
arg_num);
if (cur_param != 0 && TREE_CODE (cur_param) == ADDR_EXPR)
@ -2093,7 +2093,7 @@ check_format_types (format_wanted_type *types, const char *format_start,
&& (CONSTANT_CLASS_P (cur_param)
|| (DECL_P (cur_param)
&& TREE_READONLY (cur_param))))))
warning ("writing into constant object (argument %d)",
warning (0, "writing into constant object (argument %d)",
arg_num);
/* If there are extra type qualifiers beyond the first
@ -2104,7 +2104,7 @@ check_format_types (format_wanted_type *types, const char *format_start,
&& (TYPE_READONLY (cur_type)
|| TYPE_VOLATILE (cur_type)
|| TYPE_RESTRICT (cur_type)))
warning ("extra type qualifiers in format argument "
warning (0, "extra type qualifiers in format argument "
"(argument %d)",
arg_num);
@ -2215,20 +2215,20 @@ format_type_warning (const char *descr, const char *format_start,
if (wanted_type_name)
{
if (descr)
warning ("%s should have type %<%s%s%>, but argument %d has type %qT",
warning (0, "%s should have type %<%s%s%>, but argument %d has type %qT",
descr, wanted_type_name, p, arg_num, arg_type);
else
warning ("format %q.*s expects type %<%s%s%>, but argument %d has type %qT",
warning (0, "format %q.*s expects type %<%s%s%>, but argument %d has type %qT",
format_length, format_start, wanted_type_name, p,
arg_num, arg_type);
}
else
{
if (descr)
warning ("%s should have type %<%T%s%>, but argument %d has type %qT",
warning (0, "%s should have type %<%T%s%>, but argument %d has type %qT",
descr, wanted_type, p, arg_num, arg_type);
else
warning ("format %q.*s expects type %<%T%s%>, but argument %d has type %qT",
warning (0, "format %q.*s expects type %<%T%s%>, but argument %d has type %qT",
format_length, format_start, wanted_type, p, arg_num, arg_type);
}
}

View File

@ -204,7 +204,7 @@ gimplify_expr_stmt (tree *stmt_p)
if (!IS_EMPTY_STMT (stmt)
&& !VOID_TYPE_P (TREE_TYPE (stmt))
&& !TREE_NO_WARNING (stmt))
warning ("statement with no effect");
warning (0, "statement with no effect");
}
else if (warn_unused_value)
warn_if_unused_value (stmt, input_location);

View File

@ -251,7 +251,7 @@ fe_file_change (const struct line_map *new_map)
if (c_header_level && --c_header_level == 0)
{
if (new_map->sysp == 2)
warning ("badly nested C headers from preprocessor");
warning (0, "badly nested C headers from preprocessor");
--pending_lang_change;
}
#endif
@ -299,7 +299,7 @@ cb_def_pragma (cpp_reader *pfile, source_location loc)
name = cpp_token_as_text (pfile, s);
}
warning ("%Hignoring #pragma %s %s", &fe_loc, space, name);
warning (0, "%Hignoring #pragma %s %s", &fe_loc, space, name);
}
}
@ -597,10 +597,10 @@ interpret_integer (const cpp_token *token, unsigned int flags)
if (itk_u < itk_unsigned_long)
itk_u = itk_unsigned_long;
itk = itk_u;
warning ("this decimal constant is unsigned only in ISO C90");
warning (0, "this decimal constant is unsigned only in ISO C90");
}
else if (warn_traditional)
warning ("this decimal constant would be unsigned in ISO C90");
warning (0, "this decimal constant would be unsigned in ISO C90");
}
}
}
@ -764,7 +764,7 @@ lex_string (const cpp_token *tok, tree *valp, bool objc_string)
strs = (cpp_string *) obstack_finish (&str_ob);
if (concats && !objc_string && warn_traditional && !in_system_header)
warning ("traditional C rejects string constant concatenation");
warning (0, "traditional C rejects string constant concatenation");
if ((c_lex_string_translate
? cpp_interpret_string : cpp_interpret_string_notranslate)

View File

@ -77,7 +77,7 @@ c_cannot_inline_tree_fn (tree *fnp)
&& lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) == NULL)
{
if (do_warning)
warning ("%Jfunction %qF can never be inlined because it "
warning (0, "%Jfunction %qF can never be inlined because it "
"is suppressed using -fno-inline", fn, fn);
goto cannot_inline;
}
@ -87,7 +87,7 @@ c_cannot_inline_tree_fn (tree *fnp)
if (!DECL_DECLARED_INLINE_P (fn) && !targetm.binds_local_p (fn))
{
if (do_warning)
warning ("%Jfunction %qF can never be inlined because it might not "
warning (0, "%Jfunction %qF can never be inlined because it might not "
"be bound within this unit of translation", fn, fn);
goto cannot_inline;
}
@ -95,7 +95,7 @@ c_cannot_inline_tree_fn (tree *fnp)
if (!function_attribute_inlinable_p (fn))
{
if (do_warning)
warning ("%Jfunction %qF can never be inlined because it uses "
warning (0, "%Jfunction %qF can never be inlined because it uses "
"attributes conflicting with inlining", fn, fn);
goto cannot_inline;
}

View File

@ -550,7 +550,7 @@ c_common_handle_option (size_t scode, const char *arg, int value)
case OPT_fvtable_thunks:
case OPT_fxref:
case OPT_fvtable_gc:
warning ("switch %qs is no longer supported", option->opt_text);
warning (0, "switch %qs is no longer supported", option->opt_text);
break;
case OPT_faccess_control:
@ -663,7 +663,7 @@ c_common_handle_option (size_t scode, const char *arg, int value)
break;
case OPT_fhandle_exceptions:
warning ("-fhandle-exceptions has been renamed -fexceptions (and is now on by default)");
warning (0, "-fhandle-exceptions has been renamed -fexceptions (and is now on by default)");
flag_exceptions = value;
break;
@ -979,17 +979,17 @@ c_common_post_options (const char **pfilename)
/* Special format checking options don't work without -Wformat; warn if
they are used. */
if (warn_format_y2k && !warn_format)
warning ("-Wformat-y2k ignored without -Wformat");
warning (0, "-Wformat-y2k ignored without -Wformat");
if (warn_format_extra_args && !warn_format)
warning ("-Wformat-extra-args ignored without -Wformat");
warning (0, "-Wformat-extra-args ignored without -Wformat");
if (warn_format_zero_length && !warn_format)
warning ("-Wformat-zero-length ignored without -Wformat");
warning (0, "-Wformat-zero-length ignored without -Wformat");
if (warn_format_nonliteral && !warn_format)
warning ("-Wformat-nonliteral ignored without -Wformat");
warning (0, "-Wformat-nonliteral ignored without -Wformat");
if (warn_format_security && !warn_format)
warning ("-Wformat-security ignored without -Wformat");
warning (0, "-Wformat-security ignored without -Wformat");
if (warn_missing_format_attribute && !warn_format)
warning ("-Wmissing-format-attribute ignored without -Wformat");
warning (0, "-Wmissing-format-attribute ignored without -Wformat");
/* C99 requires special handling of complex multiplication and division;
-ffast-math and -fcx-limited-range are handled in process_options. */
@ -1096,7 +1096,7 @@ c_common_parse_file (int set_yydebug)
yydebug = set_yydebug;
#else
if (set_yydebug)
warning ("YYDEBUG was not defined at build time, -dy ignored");
warning (0, "YYDEBUG was not defined at build time, -dy ignored");
#endif
i = 0;
@ -1400,7 +1400,7 @@ void
cb_dir_change (cpp_reader * ARG_UNUSED (pfile), const char *dir)
{
if (!set_src_pwd (dir))
warning ("too late for # directive to set debug directory");
warning (0, "too late for # directive to set debug directory");
}
/* Set the C 89 standard (with 1994 amendments if C94, without GNU

View File

@ -3873,7 +3873,7 @@ c_parser_asm_statement (c_parser *parser)
else if (c_parser_next_token_is_keyword (parser, RID_CONST)
|| c_parser_next_token_is_keyword (parser, RID_RESTRICT))
{
warning ("%E qualifier ignored on asm",
warning (0, "%E qualifier ignored on asm",
c_parser_peek_token (parser)->value);
quals = NULL_TREE;
c_parser_consume_token (parser);
@ -4528,7 +4528,7 @@ c_parser_unary_expression (c_parser *parser)
case CPP_PLUS:
c_parser_consume_token (parser);
if (!c_dialect_objc () && warn_traditional && !in_system_header)
warning ("traditional C rejects the unary plus operator");
warning (0, "traditional C rejects the unary plus operator");
ret.value
= build_unary_op (CONVERT_EXPR,
c_parser_cast_expression (parser, NULL).value, 0);

View File

@ -36,8 +36,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "tm_p.h"
#include "target.h"
#define GCC_BAD(msgid) do { warning (msgid); return; } while (0)
#define GCC_BAD2(msgid, arg) do { warning (msgid, arg); return; } while (0)
#define GCC_BAD(msgid) do { warning (0, msgid); return; } while (0)
#define GCC_BAD2(msgid, arg) do { warning (0, msgid, arg); return; } while (0)
typedef struct align_stack GTY(())
{
@ -108,7 +108,7 @@ pop_alignment (tree id)
break;
}
if (entry == NULL)
warning ("\
warning (0, "\
#pragma pack(pop, %s) encountered without matching #pragma pack(push, %s)"
, IDENTIFIER_POINTER (id), IDENTIFIER_POINTER (id));
}
@ -201,7 +201,7 @@ handle_pragma_pack (cpp_reader * ARG_UNUSED (dummy))
GCC_BAD ("malformed %<#pragma pack%> - ignored");
if (c_lex (&x) != CPP_EOF)
warning ("junk at end of %<#pragma pack%>");
warning (0, "junk at end of %<#pragma pack%>");
if (flag_pack_struct)
GCC_BAD ("#pragma pack has no effect with -fpack-struct - ignored");
@ -257,7 +257,7 @@ apply_pragma_weak (tree decl, tree value)
if (SUPPORTS_WEAK && DECL_EXTERNAL (decl) && TREE_USED (decl)
&& !DECL_WEAK (decl) /* Don't complain about a redundant #pragma. */
&& TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
warning ("%Japplying #pragma weak %qD after first use results "
warning (0, "%Japplying #pragma weak %qD after first use results "
"in unspecified behavior", decl, decl);
declare_weak (decl);
@ -340,7 +340,7 @@ handle_pragma_weak (cpp_reader * ARG_UNUSED (dummy))
t = c_lex (&x);
}
if (t != CPP_EOF)
warning ("junk at end of #pragma weak");
warning (0, "junk at end of #pragma weak");
decl = identifier_global_value (name);
if (decl && DECL_P (decl))
@ -413,12 +413,12 @@ handle_pragma_redefine_extname (cpp_reader * ARG_UNUSED (dummy))
GCC_BAD ("malformed #pragma redefine_extname, ignored");
t = c_lex (&x);
if (t != CPP_EOF)
warning ("junk at end of #pragma redefine_extname");
warning (0, "junk at end of #pragma redefine_extname");
if (!flag_mudflap && !targetm.handle_pragma_redefine_extname)
{
if (warn_unknown_pragmas > in_system_header)
warning ("#pragma redefine_extname not supported on this target");
warning (0, "#pragma redefine_extname not supported on this target");
return;
}
@ -435,7 +435,7 @@ handle_pragma_redefine_extname (cpp_reader * ARG_UNUSED (dummy))
name = targetm.strip_name_encoding (name);
if (strcmp (name, IDENTIFIER_POINTER (newname)))
warning ("#pragma redefine_extname ignored due to conflict with "
warning (0, "#pragma redefine_extname ignored due to conflict with "
"previous rename");
}
else
@ -458,7 +458,7 @@ add_to_renaming_pragma_list (tree oldname, tree newname)
if (previous)
{
if (TREE_VALUE (previous) != newname)
warning ("#pragma redefine_extname ignored due to conflict with "
warning (0, "#pragma redefine_extname ignored due to conflict with "
"previous #pragma redefine_extname");
return;
}
@ -480,13 +480,13 @@ handle_pragma_extern_prefix (cpp_reader * ARG_UNUSED (dummy))
GCC_BAD ("malformed #pragma extern_prefix, ignored");
t = c_lex (&x);
if (t != CPP_EOF)
warning ("junk at end of #pragma extern_prefix");
warning (0, "junk at end of #pragma extern_prefix");
if (targetm.handle_pragma_extern_prefix)
/* Note that the length includes the null terminator. */
pragma_extern_prefix = (TREE_STRING_LENGTH (prefix) > 1 ? prefix : NULL);
else if (warn_unknown_pragmas > in_system_header)
warning ("#pragma extern_prefix not supported on this target");
warning (0, "#pragma extern_prefix not supported on this target");
}
/* Hook from the front ends to apply the results of one of the preceding
@ -512,7 +512,7 @@ maybe_apply_renaming_pragma (tree decl, tree asmname)
oldname = targetm.strip_name_encoding (oldname);
if (asmname && strcmp (TREE_STRING_POINTER (asmname), oldname))
warning ("asm declaration ignored due to "
warning (0, "asm declaration ignored due to "
"conflict with previous rename");
/* Take any pending redefine_extname off the list. */
@ -521,7 +521,7 @@ maybe_apply_renaming_pragma (tree decl, tree asmname)
{
/* Only warn if there is a conflict. */
if (strcmp (IDENTIFIER_POINTER (TREE_VALUE (t)), oldname))
warning ("#pragma redefine_extname ignored due to "
warning (0, "#pragma redefine_extname ignored due to "
"conflict with previous rename");
*p = TREE_CHAIN (t);
@ -543,7 +543,7 @@ maybe_apply_renaming_pragma (tree decl, tree asmname)
{
if (strcmp (TREE_STRING_POINTER (asmname),
IDENTIFIER_POINTER (newname)) != 0)
warning ("#pragma redefine_extname ignored due to "
warning (0, "#pragma redefine_extname ignored due to "
"conflict with __asm__ declaration");
return asmname;
}
@ -654,7 +654,7 @@ handle_pragma_visibility (cpp_reader *dummy ATTRIBUTE_UNUSED)
}
}
if (c_lex (&x) != CPP_EOF)
warning ("junk at end of %<#pragma GCC visibility%>");
warning (0, "junk at end of %<#pragma GCC visibility%>");
}
#endif

View File

@ -1068,7 +1068,7 @@ function_types_compatible_p (tree f1, tree f2)
return 0;
/* If one of these types comes from a non-prototype fn definition,
compare that with the other type's arglist.
If they don't match, ask for a warning (but no error). */
If they don't match, ask for a warning (0, but no error). */
if (TYPE_ACTUAL_ARG_TYPES (f1)
&& 1 != type_lists_compatible_p (args2, TYPE_ACTUAL_ARG_TYPES (f1)))
val = 2;
@ -1646,7 +1646,7 @@ build_indirect_ref (tree ptr, const char *errorstring)
return error_mark_node;
}
if (VOID_TYPE_P (t) && skip_evaluation == 0)
warning ("dereferencing %<void *%> pointer");
warning (0, "dereferencing %<void *%> pointer");
/* We *must* set TREE_READONLY when dereferencing a pointer to const,
so that we get the proper error message if the result is used
@ -1721,7 +1721,7 @@ build_array_ref (tree array, tree index)
char[array]. */
if (warn_char_subscripts && !swapped
&& TYPE_MAIN_VARIANT (TREE_TYPE (index)) == char_type_node)
warning ("array subscript has type %<char%>");
warning (0, "array subscript has type %<char%>");
/* Apply default promotions *after* noticing character types. */
index = default_conversion (index);
@ -2040,7 +2040,7 @@ build_function_call (tree function, tree params)
/* This situation leads to run-time undefined behavior. We can't,
therefore, simply error unless we can prove that all possible
executions of the program must execute the code. */
warning ("function called through a non-compatible type");
warning (0, "function called through a non-compatible type");
/* We can, however, treat "undefined" any way we please.
Call abort to encourage the user to fix the program. */
@ -2185,32 +2185,32 @@ convert_arguments (tree typelist, tree values, tree function, tree fundecl)
if (INTEGRAL_TYPE_P (type)
&& TREE_CODE (TREE_TYPE (val)) == REAL_TYPE)
warning ("passing argument %d of %qE as integer "
warning (0, "passing argument %d of %qE as integer "
"rather than floating due to prototype",
argnum, rname);
if (INTEGRAL_TYPE_P (type)
&& TREE_CODE (TREE_TYPE (val)) == COMPLEX_TYPE)
warning ("passing argument %d of %qE as integer "
warning (0, "passing argument %d of %qE as integer "
"rather than complex due to prototype",
argnum, rname);
else if (TREE_CODE (type) == COMPLEX_TYPE
&& TREE_CODE (TREE_TYPE (val)) == REAL_TYPE)
warning ("passing argument %d of %qE as complex "
warning (0, "passing argument %d of %qE as complex "
"rather than floating due to prototype",
argnum, rname);
else if (TREE_CODE (type) == REAL_TYPE
&& INTEGRAL_TYPE_P (TREE_TYPE (val)))
warning ("passing argument %d of %qE as floating "
warning (0, "passing argument %d of %qE as floating "
"rather than integer due to prototype",
argnum, rname);
else if (TREE_CODE (type) == COMPLEX_TYPE
&& INTEGRAL_TYPE_P (TREE_TYPE (val)))
warning ("passing argument %d of %qE as complex "
warning (0, "passing argument %d of %qE as complex "
"rather than integer due to prototype",
argnum, rname);
else if (TREE_CODE (type) == REAL_TYPE
&& TREE_CODE (TREE_TYPE (val)) == COMPLEX_TYPE)
warning ("passing argument %d of %qE as floating "
warning (0, "passing argument %d of %qE as floating "
"rather than complex due to prototype",
argnum, rname);
/* ??? At some point, messages should be written about
@ -2222,7 +2222,7 @@ convert_arguments (tree typelist, tree values, tree function, tree fundecl)
/* Warn if any argument is passed as `float',
since without a prototype it would be `double'. */
if (formal_prec == TYPE_PRECISION (float_type_node))
warning ("passing argument %d of %qE as %<float%> "
warning (0, "passing argument %d of %qE as %<float%> "
"rather than %<double%> due to prototype",
argnum, rname);
}
@ -2242,7 +2242,7 @@ convert_arguments (tree typelist, tree values, tree function, tree fundecl)
and the actual arg is that enum type. */
;
else if (formal_prec != TYPE_PRECISION (type1))
warning ("passing argument %d of %qE with different "
warning (0, "passing argument %d of %qE with different "
"width due to prototype", argnum, rname);
else if (TYPE_UNSIGNED (type) == TYPE_UNSIGNED (type1))
;
@ -2264,10 +2264,10 @@ convert_arguments (tree typelist, tree values, tree function, tree fundecl)
&& TYPE_UNSIGNED (TREE_TYPE (val)))
;
else if (TYPE_UNSIGNED (type))
warning ("passing argument %d of %qE as unsigned "
warning (0, "passing argument %d of %qE as unsigned "
"due to prototype", argnum, rname);
else
warning ("passing argument %d of %qE as signed "
warning (0, "passing argument %d of %qE as signed "
"due to prototype", argnum, rname);
}
}
@ -2340,14 +2340,14 @@ parser_build_binary_op (enum tree_code code, struct c_expr arg1,
{
if (code1 == PLUS_EXPR || code1 == MINUS_EXPR
|| code2 == PLUS_EXPR || code2 == MINUS_EXPR)
warning ("suggest parentheses around + or - inside shift");
warning (0, "suggest parentheses around + or - inside shift");
}
if (code == TRUTH_ORIF_EXPR)
{
if (code1 == TRUTH_ANDIF_EXPR
|| code2 == TRUTH_ANDIF_EXPR)
warning ("suggest parentheses around && within ||");
warning (0, "suggest parentheses around && within ||");
}
if (code == BIT_IOR_EXPR)
@ -2356,11 +2356,11 @@ parser_build_binary_op (enum tree_code code, struct c_expr arg1,
|| code1 == PLUS_EXPR || code1 == MINUS_EXPR
|| code2 == BIT_AND_EXPR || code2 == BIT_XOR_EXPR
|| code2 == PLUS_EXPR || code2 == MINUS_EXPR)
warning ("suggest parentheses around arithmetic in operand of |");
warning (0, "suggest parentheses around arithmetic in operand of |");
/* Check cases like x|y==z */
if (TREE_CODE_CLASS (code1) == tcc_comparison
|| TREE_CODE_CLASS (code2) == tcc_comparison)
warning ("suggest parentheses around comparison in operand of |");
warning (0, "suggest parentheses around comparison in operand of |");
}
if (code == BIT_XOR_EXPR)
@ -2369,28 +2369,28 @@ parser_build_binary_op (enum tree_code code, struct c_expr arg1,
|| code1 == PLUS_EXPR || code1 == MINUS_EXPR
|| code2 == BIT_AND_EXPR
|| code2 == PLUS_EXPR || code2 == MINUS_EXPR)
warning ("suggest parentheses around arithmetic in operand of ^");
warning (0, "suggest parentheses around arithmetic in operand of ^");
/* Check cases like x^y==z */
if (TREE_CODE_CLASS (code1) == tcc_comparison
|| TREE_CODE_CLASS (code2) == tcc_comparison)
warning ("suggest parentheses around comparison in operand of ^");
warning (0, "suggest parentheses around comparison in operand of ^");
}
if (code == BIT_AND_EXPR)
{
if (code1 == PLUS_EXPR || code1 == MINUS_EXPR
|| code2 == PLUS_EXPR || code2 == MINUS_EXPR)
warning ("suggest parentheses around + or - in operand of &");
warning (0, "suggest parentheses around + or - in operand of &");
/* Check cases like x&y==z */
if (TREE_CODE_CLASS (code1) == tcc_comparison
|| TREE_CODE_CLASS (code2) == tcc_comparison)
warning ("suggest parentheses around comparison in operand of &");
warning (0, "suggest parentheses around comparison in operand of &");
}
/* Similarly, check for cases like 1<=i<=10 that are probably errors. */
if (TREE_CODE_CLASS (code) == tcc_comparison
&& (TREE_CODE_CLASS (code1) == tcc_comparison
|| TREE_CODE_CLASS (code2) == tcc_comparison))
warning ("comparisons like X<=Y<=Z do not have their mathematical meaning");
warning (0, "comparisons like X<=Y<=Z do not have their mathematical meaning");
}
@ -3003,7 +3003,7 @@ build_conditional_expr (tree ifexp, tree op1, tree op2)
|| (unsigned_op1 && tree_expr_nonnegative_p (op2)))
/* OK */;
else
warning ("signed and unsigned type in conditional expression");
warning (0, "signed and unsigned type in conditional expression");
}
}
}
@ -3111,7 +3111,7 @@ build_compound_expr (tree expr1, tree expr2)
if (warn_unused_value
&& !(TREE_CODE (expr1) == CONVERT_EXPR
&& VOID_TYPE_P (TREE_TYPE (expr1))))
warning ("left-hand operand of comma expression has no effect");
warning (0, "left-hand operand of comma expression has no effect");
}
/* With -Wunused, we should also warn if the left-hand operand does have
@ -3238,12 +3238,12 @@ build_c_cast (tree type, tree expr)
&& TREE_CODE (in_otype) == POINTER_TYPE);
if (added)
warning ("cast adds new qualifiers to function type");
warning (0, "cast adds new qualifiers to function type");
if (discarded)
/* There are qualifiers present in IN_OTYPE that are not
present in IN_TYPE. */
warning ("cast discards qualifiers from pointer target type");
warning (0, "cast discards qualifiers from pointer target type");
}
/* Warn about possible alignment problems. */
@ -3258,19 +3258,19 @@ build_c_cast (tree type, tree expr)
|| TREE_CODE (TREE_TYPE (otype)) == RECORD_TYPE)
&& TYPE_MODE (TREE_TYPE (otype)) == VOIDmode)
&& TYPE_ALIGN (TREE_TYPE (type)) > TYPE_ALIGN (TREE_TYPE (otype)))
warning ("cast increases required alignment of target type");
warning (0, "cast increases required alignment of target type");
if (warn_pointer_to_int_cast
&& TREE_CODE (type) == INTEGER_TYPE
&& TREE_CODE (otype) == POINTER_TYPE
&& TYPE_PRECISION (type) != TYPE_PRECISION (otype)
&& !TREE_CONSTANT (value))
warning ("cast from pointer to integer of different size");
warning (0, "cast from pointer to integer of different size");
if (warn_bad_function_cast
&& TREE_CODE (value) == CALL_EXPR
&& TREE_CODE (type) != TREE_CODE (otype))
warning ("cast from function call of type %qT to non-matching "
warning (0, "cast from function call of type %qT to non-matching "
"type %qT", otype, type);
if (warn_int_to_pointer_cast
@ -3279,7 +3279,7 @@ build_c_cast (tree type, tree expr)
&& TYPE_PRECISION (type) != TYPE_PRECISION (otype)
/* Don't warn about converting any constant. */
&& !TREE_CONSTANT (value))
warning ("cast to pointer from integer of different size");
warning (0, "cast to pointer from integer of different size");
if (TREE_CODE (type) == POINTER_TYPE
&& TREE_CODE (otype) == POINTER_TYPE
@ -3291,17 +3291,17 @@ build_c_cast (tree type, tree expr)
/* Casting the address of a decl to non void pointer. Warn
if the cast breaks type based aliasing. */
if (!COMPLETE_TYPE_P (TREE_TYPE (type)))
warning ("type-punning to incomplete type might break strict-aliasing rules");
warning (0, "type-punning to incomplete type might break strict-aliasing rules");
else
{
HOST_WIDE_INT set1 = get_alias_set (TREE_TYPE (TREE_OPERAND (expr, 0)));
HOST_WIDE_INT set2 = get_alias_set (TREE_TYPE (type));
if (!alias_sets_conflict_p (set1, set2))
warning ("dereferencing type-punned pointer will break strict-aliasing rules");
warning (0, "dereferencing type-punned pointer will break strict-aliasing rules");
else if (warn_strict_aliasing > 1
&& !alias_sets_might_conflict_p (set1, set2))
warning ("dereferencing type-punned pointer might break strict-aliasing rules");
warning (0, "dereferencing type-punned pointer might break strict-aliasing rules");
}
}
@ -3507,7 +3507,7 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype,
pedwarn (AR, parmnum, rname); \
break; \
case ic_argpass_nonproto: \
warning (AR, parmnum, rname); \
warning (0, AR, parmnum, rname); \
break; \
case ic_assign: \
pedwarn (AS); \
@ -3950,7 +3950,7 @@ store_init_value (tree decl, tree init)
if (warn_traditional && !in_system_header
&& AGGREGATE_TYPE_P (TREE_TYPE (decl)) && !TREE_STATIC (decl))
warning ("traditional C rejects automatic aggregate initialization");
warning (0, "traditional C rejects automatic aggregate initialization");
DECL_INITIAL (decl) = value;
@ -4144,10 +4144,10 @@ warning_init (const char *msgid)
{
char *ofwhat;
warning ("%s", _(msgid));
warning (0, "%s", _(msgid));
ofwhat = print_spelling ((char *) alloca (spelling_length () + 1));
if (*ofwhat)
warning ("(near initialization for %qs)", ofwhat);
warning (0, "(near initialization for %qs)", ofwhat);
}
/* If TYPE is an array type and EXPR is a parenthesized string
@ -6186,7 +6186,7 @@ process_init_element (struct c_expr value)
if (warn_traditional && !in_system_header && !constructor_designated
&& !(value.value && (integer_zerop (value.value)
|| real_zerop (value.value))))
warning ("traditional C rejects initialization of unions");
warning (0, "traditional C rejects initialization of unions");
/* Accept a string constant to initialize a subarray. */
if (value.value != 0
@ -6549,7 +6549,7 @@ c_finish_return (tree retval)
tree valtype = TREE_TYPE (TREE_TYPE (current_function_decl));
if (TREE_THIS_VOLATILE (current_function_decl))
warning ("function declared %<noreturn%> has a %<return%> statement");
warning (0, "function declared %<noreturn%> has a %<return%> statement");
if (!retval)
{
@ -6620,7 +6620,7 @@ c_finish_return (tree retval)
&& !DECL_EXTERNAL (inner)
&& !TREE_STATIC (inner)
&& DECL_CONTEXT (inner) == current_function_decl)
warning ("function returns address of local variable");
warning (0, "function returns address of local variable");
break;
default:
@ -6702,7 +6702,7 @@ c_start_case (tree exp)
if (warn_traditional && !in_system_header
&& (type == long_integer_type_node
|| type == long_unsigned_type_node))
warning ("%<long%> switch expression not converted to "
warning (0, "%<long%> switch expression not converted to "
"%<int%> in ISO C");
exp = default_conversion (exp);
@ -6837,7 +6837,7 @@ c_finish_if_stmt (location_t if_locus, tree cond, tree then_block,
found:
if (COND_EXPR_ELSE (inner_if))
warning ("%Hsuggest explicit braces to avoid ambiguous %<else%>",
warning (0, "%Hsuggest explicit braces to avoid ambiguous %<else%>",
&if_locus);
}
@ -6847,7 +6847,7 @@ c_finish_if_stmt (location_t if_locus, tree cond, tree then_block,
if (TREE_CODE (then_block) == NOP_EXPR && !TREE_TYPE (then_block))
{
if (!else_block)
warning ("%Hempty body in an if-statement",
warning (0, "%Hempty body in an if-statement",
EXPR_LOCUS (then_block));
then_block = alloc_stmt_list ();
}
@ -6855,7 +6855,7 @@ c_finish_if_stmt (location_t if_locus, tree cond, tree then_block,
&& TREE_CODE (else_block) == NOP_EXPR
&& !TREE_TYPE (else_block))
{
warning ("%Hempty body in an else-statement",
warning (0, "%Hempty body in an else-statement",
EXPR_LOCUS (else_block));
else_block = alloc_stmt_list ();
}
@ -6986,7 +6986,7 @@ emit_side_effect_warnings (tree expr)
else if (!TREE_SIDE_EFFECTS (expr))
{
if (!VOID_TYPE_P (TREE_TYPE (expr)) && !TREE_NO_WARNING (expr))
warning ("%Hstatement with no effect",
warning (0, "%Hstatement with no effect",
EXPR_HAS_LOCATION (expr) ? EXPR_LOCUS (expr) : &input_location);
}
else if (warn_unused_value)
@ -7454,7 +7454,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
/* Floating point division by zero is a legitimate way to obtain
infinities and NaNs. */
if (warn_div_by_zero && skip_evaluation == 0 && integer_zerop (op1))
warning ("division by zero");
warning (0, "division by zero");
if ((code0 == INTEGER_TYPE || code0 == REAL_TYPE
|| code0 == COMPLEX_TYPE || code0 == VECTOR_TYPE)
@ -7493,7 +7493,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
case TRUNC_MOD_EXPR:
case FLOOR_MOD_EXPR:
if (warn_div_by_zero && skip_evaluation == 0 && integer_zerop (op1))
warning ("division by zero");
warning (0, "division by zero");
if (code0 == INTEGER_TYPE && code1 == INTEGER_TYPE)
{
@ -7538,14 +7538,14 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
if (TREE_CODE (op1) == INTEGER_CST && skip_evaluation == 0)
{
if (tree_int_cst_sgn (op1) < 0)
warning ("right shift count is negative");
warning (0, "right shift count is negative");
else
{
if (!integer_zerop (op1))
short_shift = 1;
if (compare_tree_int (op1, TYPE_PRECISION (type0)) >= 0)
warning ("right shift count >= width of type");
warning (0, "right shift count >= width of type");
}
}
@ -7566,10 +7566,10 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
if (TREE_CODE (op1) == INTEGER_CST && skip_evaluation == 0)
{
if (tree_int_cst_sgn (op1) < 0)
warning ("left shift count is negative");
warning (0, "left shift count is negative");
else if (compare_tree_int (op1, TYPE_PRECISION (type0)) >= 0)
warning ("left shift count >= width of type");
warning (0, "left shift count >= width of type");
}
/* Use the type of the value to be shifted. */
@ -7586,7 +7586,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
case EQ_EXPR:
case NE_EXPR:
if (warn_float_equal && (code0 == REAL_TYPE || code1 == REAL_TYPE))
warning ("comparing floating point with == or != is unsafe");
warning (0, "comparing floating point with == or != is unsafe");
/* Result of comparison is always int,
but don't convert the args to int! */
build_type = integer_type_node;
@ -7903,7 +7903,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
c_common_signed_type (result_type)))
/* OK */;
else
warning ("comparison between signed and unsigned");
warning (0, "comparison between signed and unsigned");
}
/* Warn if two unsigned values are being compared in a size
@ -7949,7 +7949,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 ("comparison of promoted ~unsigned with constant");
warning (0, "comparison of promoted ~unsigned with constant");
}
}
else if (unsignedp0 && unsignedp1
@ -7957,7 +7957,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 ("comparison of promoted ~unsigned with unsigned");
warning (0, "comparison of promoted ~unsigned with unsigned");
}
}
}

View File

@ -1935,7 +1935,7 @@ expand_call (tree exp, rtx target, int ignore)
/* Warn if this value is an aggregate type,
regardless of which calling convention we are using for it. */
if (warn_aggregate_return && AGGREGATE_TYPE_P (TREE_TYPE (exp)))
warning ("function call has aggregate value");
warning (0, "function call has aggregate value");
/* If the result of a pure or const function call is ignored (or void),
and none of its arguments are volatile, we can avoid expanding the

View File

@ -712,7 +712,7 @@ change_decl_assembler_name (tree decl, tree name)
if (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))
&& DECL_RTL_SET_P (decl))
warning ("%D renamed after being referenced in assembly", decl);
warning (0, "%D renamed after being referenced in assembly", decl);
SET_DECL_ASSEMBLER_NAME (decl, name);
}

View File

@ -310,7 +310,7 @@ override_options (void)
/* Unicos/Mk doesn't have shared libraries. */
if (TARGET_ABI_UNICOSMK && flag_pic)
{
warning ("-f%s ignored for Unicos/Mk (not supported)",
warning (0, "-f%s ignored for Unicos/Mk (not supported)",
(flag_pic > 1) ? "PIC" : "pic");
flag_pic = 0;
}
@ -334,7 +334,7 @@ override_options (void)
if (TARGET_IEEE)
{
if (TARGET_ABI_UNICOSMK)
warning ("-mieee not supported on Unicos/Mk");
warning (0, "-mieee not supported on Unicos/Mk");
else
{
alpha_tp = ALPHA_TP_INSN;
@ -345,7 +345,7 @@ override_options (void)
if (TARGET_IEEE_WITH_INEXACT)
{
if (TARGET_ABI_UNICOSMK)
warning ("-mieee-with-inexact not supported on Unicos/Mk");
warning (0, "-mieee-with-inexact not supported on Unicos/Mk");
else
{
alpha_tp = ALPHA_TP_INSN;
@ -424,14 +424,14 @@ override_options (void)
if (TARGET_ABI_UNICOSMK && alpha_fptm != ALPHA_FPTM_N)
{
warning ("trap mode not supported on Unicos/Mk");
warning (0, "trap mode not supported on Unicos/Mk");
alpha_fptm = ALPHA_FPTM_N;
}
if ((alpha_fptm == ALPHA_FPTM_SU || alpha_fptm == ALPHA_FPTM_SUI)
&& alpha_tp != ALPHA_TP_INSN && alpha_cpu != PROCESSOR_EV6)
{
warning ("fp software completion requires -mtrap-precision=i");
warning (0, "fp software completion requires -mtrap-precision=i");
alpha_tp = ALPHA_TP_INSN;
}
@ -447,16 +447,16 @@ override_options (void)
{
if (alpha_fprm == ALPHA_FPRM_MINF || alpha_fprm == ALPHA_FPRM_DYN)
{
warning ("rounding mode not supported for VAX floats");
warning (0, "rounding mode not supported for VAX floats");
alpha_fprm = ALPHA_FPRM_NORM;
}
if (alpha_fptm == ALPHA_FPTM_SUI)
{
warning ("trap mode not supported for VAX floats");
warning (0, "trap mode not supported for VAX floats");
alpha_fptm = ALPHA_FPTM_SU;
}
if (target_flags_explicit & MASK_LONG_DOUBLE_128)
warning ("128-bit long double not supported for VAX floats");
warning (0, "128-bit long double not supported for VAX floats");
target_flags &= ~MASK_LONG_DOUBLE_128;
}
@ -484,7 +484,7 @@ override_options (void)
lat = alpha_mlat_string[1] - '0';
if (lat <= 0 || lat > 3 || cache_latency[alpha_tune][lat-1] == -1)
{
warning ("L%d cache latency unknown for %s",
warning (0, "L%d cache latency unknown for %s",
lat, alpha_cpu_name[alpha_tune]);
lat = 3;
}
@ -499,7 +499,7 @@ override_options (void)
}
else
{
warning ("bad value %qs for -mmemory-latency", alpha_mlat_string);
warning (0, "bad value %qs for -mmemory-latency", alpha_mlat_string);
lat = 3;
}

View File

@ -410,14 +410,14 @@ arc_handle_interrupt_attribute (tree *node ATTRIBUTE_UNUSED,
if (TREE_CODE (value) != STRING_CST)
{
warning ("argument of %qs attribute is not a string constant",
warning (0, "argument of %qs attribute is not a string constant",
IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
else if (strcmp (TREE_STRING_POINTER (value), "ilink1")
&& strcmp (TREE_STRING_POINTER (value), "ilink2"))
{
warning ("argument of %qs attribute is not \"ilink1\" or \"ilink2\"",
warning (0, "argument of %qs attribute is not \"ilink1\" or \"ilink2\"",
IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}

View File

@ -806,7 +806,7 @@ arm_override_options (void)
a warning though, and we prefer the CPU over the
architecture. */
if (insn_flags != 0 && (insn_flags ^ sel->flags))
warning ("switch -mcpu=%s conflicts with -march= switch",
warning (0, "switch -mcpu=%s conflicts with -march= switch",
ptr->string);
insn_flags = sel->flags;
@ -925,19 +925,19 @@ arm_override_options (void)
other command line choices. */
if (TARGET_INTERWORK && !(insn_flags & FL_THUMB))
{
warning ("target CPU does not support interworking" );
warning (0, "target CPU does not support interworking" );
target_flags &= ~ARM_FLAG_INTERWORK;
}
if (TARGET_THUMB && !(insn_flags & FL_THUMB))
{
warning ("target CPU does not support THUMB instructions");
warning (0, "target CPU does not support THUMB instructions");
target_flags &= ~ARM_FLAG_THUMB;
}
if (TARGET_APCS_FRAME && TARGET_THUMB)
{
/* warning ("ignoring -mapcs-frame because -mthumb was used"); */
/* warning (0, "ignoring -mapcs-frame because -mthumb was used"); */
target_flags &= ~ARM_FLAG_APCS_FRAME;
}
@ -945,17 +945,17 @@ arm_override_options (void)
from here where no function is being compiled currently. */
if ((target_flags & (THUMB_FLAG_LEAF_BACKTRACE | THUMB_FLAG_BACKTRACE))
&& TARGET_ARM)
warning ("enabling backtrace support is only meaningful when compiling for the Thumb");
warning (0, "enabling backtrace support is only meaningful when compiling for the Thumb");
if (TARGET_ARM && TARGET_CALLEE_INTERWORKING)
warning ("enabling callee interworking support is only meaningful when compiling for the Thumb");
warning (0, "enabling callee interworking support is only meaningful when compiling for the Thumb");
if (TARGET_ARM && TARGET_CALLER_INTERWORKING)
warning ("enabling caller interworking support is only meaningful when compiling for the Thumb");
warning (0, "enabling caller interworking support is only meaningful when compiling for the Thumb");
if (TARGET_APCS_STACK && !TARGET_APCS_FRAME)
{
warning ("-mapcs-stack-check incompatible with -mno-apcs-frame");
warning (0, "-mapcs-stack-check incompatible with -mno-apcs-frame");
target_flags |= ARM_FLAG_APCS_FRAME;
}
@ -966,7 +966,7 @@ arm_override_options (void)
error ("-fpic and -mapcs-reent are incompatible");
if (TARGET_APCS_REENT)
warning ("APCS reentrant code not supported. Ignored");
warning (0, "APCS reentrant code not supported. Ignored");
/* If this target is normally configured to use APCS frames, warn if they
are turned off and debugging is turned on. */
@ -974,7 +974,7 @@ arm_override_options (void)
&& write_symbols != NO_DEBUG
&& !TARGET_APCS_FRAME
&& (TARGET_DEFAULT & ARM_FLAG_APCS_FRAME))
warning ("-g with -mno-apcs-frame may not give sensible debugging");
warning (0, "-g with -mno-apcs-frame may not give sensible debugging");
/* If stack checking is disabled, we can use r10 as the PIC register,
which keeps r9 available. */
@ -982,7 +982,7 @@ arm_override_options (void)
arm_pic_register = TARGET_APCS_STACK ? 9 : 10;
if (TARGET_APCS_FLOAT)
warning ("passing floating point arguments in fp regs not yet supported");
warning (0, "passing floating point arguments in fp regs not yet supported");
/* Initialize boolean versions of the flags, for use in the arm.md file. */
arm_arch3m = (insn_flags & FL_ARCH3M) != 0;
@ -1141,7 +1141,7 @@ arm_override_options (void)
|| (ARM_DOUBLEWORD_ALIGN && size == 64))
arm_structure_size_boundary = size;
else
warning ("structure size boundary can only be set to %s",
warning (0, "structure size boundary can only be set to %s",
ARM_DOUBLEWORD_ALIGN ? "8, 32 or 64": "8 or 32");
}
@ -1150,7 +1150,7 @@ arm_override_options (void)
int pic_register = decode_reg_name (arm_pic_register_string);
if (!flag_pic)
warning ("-mpic-register= is useless without -fpic");
warning (0, "-mpic-register= is useless without -fpic");
/* Prevent the user from choosing an obviously stupid PIC register. */
else if (pic_register < 0 || call_used_regs[pic_register]
@ -2674,7 +2674,7 @@ arm_handle_fndecl_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED,
{
if (TREE_CODE (*node) != FUNCTION_DECL)
{
warning ("%qs attribute only applies to functions",
warning (0, "%qs attribute only applies to functions",
IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
@ -2692,7 +2692,7 @@ arm_handle_isr_attribute (tree *node, tree name, tree args, int flags,
{
if (TREE_CODE (*node) != FUNCTION_DECL)
{
warning ("%qs attribute only applies to functions",
warning (0, "%qs attribute only applies to functions",
IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
@ -2706,7 +2706,7 @@ arm_handle_isr_attribute (tree *node, tree name, tree args, int flags,
{
if (arm_isr_value (args) == ARM_FT_UNKNOWN)
{
warning ("%qs attribute ignored", IDENTIFIER_POINTER (name));
warning (0, "%qs attribute ignored", IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
}
@ -2733,7 +2733,7 @@ arm_handle_isr_attribute (tree *node, tree name, tree args, int flags,
}
else
{
warning ("%qs attribute ignored", IDENTIFIER_POINTER (name));
warning (0, "%qs attribute ignored", IDENTIFIER_POINTER (name));
}
}
}
@ -11400,7 +11400,7 @@ arm_debugger_arg_offset (int value, rtx addr)
if (value == 0)
{
debug_rtx (addr);
warning ("unable to compute real location of stacked parameter");
warning (0, "unable to compute real location of stacked parameter");
value = 8; /* XXX magic hack */
}

View File

@ -552,7 +552,7 @@ out_adj_frame_ptr (FILE *file, int adj)
if (TARGET_TINY_STACK)
{
if (adj < -63 || adj > 63)
warning ("large frame pointer change (%d) with -mtiny-stack", adj);
warning (0, "large frame pointer change (%d) with -mtiny-stack", adj);
/* The high byte (r29) doesn't change - prefer "subi" (1 cycle)
over "sbiw" (2 cycles, same size). */
@ -4670,14 +4670,14 @@ avr_handle_progmem_attribute (tree *node, tree name,
{
if (DECL_INITIAL (*node) == NULL_TREE && !DECL_EXTERNAL (*node))
{
warning ("only initialized variables can be placed into "
warning (0, "only initialized variables can be placed into "
"program memory area");
*no_add_attrs = true;
}
}
else
{
warning ("%qs attribute ignored", IDENTIFIER_POINTER (name));
warning (0, "%qs attribute ignored", IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
}
@ -4696,7 +4696,7 @@ avr_handle_fndecl_attribute (tree *node, tree name,
{
if (TREE_CODE (*node) != FUNCTION_DECL)
{
warning ("%qs attribute only applies to functions",
warning (0, "%qs attribute only applies to functions",
IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
@ -4713,7 +4713,7 @@ avr_handle_fndecl_attribute (tree *node, tree name,
{
if (strncmp (func_name, "__vector", strlen ("__vector")) != 0)
{
warning ("`%s' appears to be a misspelled interrupt handler",
warning (0, "`%s' appears to be a misspelled interrupt handler",
func_name);
}
}
@ -4721,7 +4721,7 @@ avr_handle_fndecl_attribute (tree *node, tree name,
{
if (strncmp (func_name, "__vector", strlen ("__vector")) != 0)
{
warning ("`%s' appears to be a misspelled signal handler",
warning (0, "`%s' appears to be a misspelled signal handler",
func_name);
}
}
@ -4790,7 +4790,7 @@ avr_section_type_flags (tree decl, const char *name, int reloc)
&& DECL_INITIAL (decl) == NULL_TREE)
flags |= SECTION_BSS; /* @nobits */
else
warning ("only uninitialized variables can be placed in the "
warning (0, "only uninitialized variables can be placed in the "
".noinit section");
}

View File

@ -2554,7 +2554,7 @@ handle_int_attribute (tree *node, tree name,
if (TREE_CODE (x) != FUNCTION_TYPE)
{
warning ("%qs attribute only applies to functions",
warning (0, "%qs attribute only applies to functions",
IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}

View File

@ -57,7 +57,7 @@ static int c4x_parse_pragma (const char *, tree *, tree *);
the STRING_CST node of the string. If SECT is null, then this
pragma doesn't take a section string. Returns 0 for a good pragma,
-1 for a malformed pragma. */
#define BAD(msgid, arg) do { warning (msgid, arg); return -1; } while (0)
#define BAD(msgid, arg) do { warning (0, msgid, arg); return -1; } while (0)
static int
c4x_parse_pragma (name, func, sect)
@ -86,7 +86,7 @@ c4x_parse_pragma (name, func, sect)
BAD ("missing ')' for '#pragma %s' - ignored", name);
if (c_lex (&x) != CPP_EOF)
warning ("junk at end of '#pragma %s'", name);
warning (0, "junk at end of '#pragma %s'", name);
*func = f;
return 0;

View File

@ -4485,7 +4485,7 @@ c4x_handle_fntype_attribute (tree *node, tree name,
{
if (TREE_CODE (*node) != FUNCTION_TYPE)
{
warning ("%qs attribute only applies to functions",
warning (0, "%qs attribute only applies to functions",
IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}

View File

@ -2218,7 +2218,7 @@ cris_override_options (void)
if (write_symbols == DWARF2_DEBUG && ! TARGET_ELF)
{
warning ("that particular -g option is invalid with -maout and -melinux");
warning (0, "that particular -g option is invalid with -maout and -melinux");
write_symbols = DBX_DEBUG;
}
@ -2730,7 +2730,7 @@ cris_expand_prologue (void)
}
if (cris_max_stackframe && framesize > cris_max_stackframe)
warning ("stackframe too big: %d bytes", framesize);
warning (0, "stackframe too big: %d bytes", framesize);
}
/* The expander for the epilogue pattern. */

View File

@ -35,7 +35,7 @@ Boston, MA 02111-1307, USA. */
/* Pragmas. */
#define BAD(msgid) do { warning (msgid); return; } while (0)
#define BAD(msgid) do { warning (0, msgid); return; } while (0)
static bool using_frameworks = false;
@ -111,7 +111,7 @@ darwin_pragma_options (cpp_reader *pfile ATTRIBUTE_UNUSED)
BAD ("malformed '#pragma options', ignoring");
if (c_lex (&x) != CPP_EOF)
warning ("junk at end of '#pragma options'");
warning (0, "junk at end of '#pragma options'");
arg = IDENTIFIER_POINTER (t);
if (!strcmp (arg, "mac68k"))
@ -121,7 +121,7 @@ darwin_pragma_options (cpp_reader *pfile ATTRIBUTE_UNUSED)
else if (!strcmp (arg, "reset"))
pop_field_alignment ();
else
warning ("malformed '#pragma options align={mac68k|power|reset}', ignoring");
warning (0, "malformed '#pragma options align={mac68k|power|reset}', ignoring");
}
/* #pragma unused ([var {, var}*]) */
@ -154,7 +154,7 @@ darwin_pragma_unused (cpp_reader *pfile ATTRIBUTE_UNUSED)
BAD ("missing ')' after '#pragma unused', ignoring");
if (c_lex (&x) != CPP_EOF)
warning ("junk at end of '#pragma unused'");
warning (0, "junk at end of '#pragma unused'");
}
static struct {
@ -380,7 +380,7 @@ find_subframework_file (const char *fname, const char *pname)
if (fast_dir != &subframe_dir)
{
if (fast_dir)
warning ("subframework include %s conflicts with framework include",
warning (0, "subframework include %s conflicts with framework include",
fname);
else
add_framework (fname, fname_len, &subframe_dir);

View File

@ -1231,7 +1231,7 @@ darwin_handle_weak_import_attribute (tree *node, tree name,
{
if (TREE_CODE (*node) != FUNCTION_DECL && TREE_CODE (*node) != VAR_DECL)
{
warning ("%qs attribute ignored", IDENTIFIER_POINTER (name));
warning (0, "%qs attribute ignored", IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
else
@ -1345,7 +1345,7 @@ darwin_assemble_visibility (tree decl, int vis)
fputs ("\n", asm_out_file);
}
else
warning ("internal and protected visibility attributes not supported "
warning (0, "internal and protected visibility attributes not supported "
"in this configuration; ignored");
}

View File

@ -374,7 +374,7 @@ Boston, MA 02111-1307, USA. */
do { \
if (ALIAS) \
{ \
warning ("alias definitions not supported in Mach-O; ignored"); \
warning (0, "alias definitions not supported in Mach-O; ignored"); \
break; \
} \
\

View File

@ -5264,7 +5264,7 @@ h8300_handle_fndecl_attribute (tree *node, tree name,
{
if (TREE_CODE (*node) != FUNCTION_DECL)
{
warning ("%qs attribute only applies to functions",
warning (0, "%qs attribute only applies to functions",
IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
@ -5288,7 +5288,7 @@ h8300_handle_eightbit_data_attribute (tree *node, tree name,
}
else
{
warning ("%qs attribute ignored", IDENTIFIER_POINTER (name));
warning (0, "%qs attribute ignored", IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
@ -5311,7 +5311,7 @@ h8300_handle_tiny_data_attribute (tree *node, tree name,
}
else
{
warning ("%qs attribute ignored", IDENTIFIER_POINTER (name));
warning (0, "%qs attribute ignored", IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}

View File

@ -162,7 +162,7 @@ switch_to_section (enum in_section section, tree decl) \
do { \
if (flag_pic) \
{ \
warning ("-f%s ignored for target (all code is position independent)",\
warning (0, "-f%s ignored for target (all code is position independent)",\
(flag_pic > 1) ? "PIC" : "pic"); \
flag_pic = 0; \
} \

View File

@ -178,7 +178,7 @@ do \
{ \
if (TARGET_BNU210) \
{ \
warning ("-mbnu210 is ignored (option is obsolete)"); \
warning (0, "-mbnu210 is ignored (option is obsolete)"); \
} \
} \
while (0)

View File

@ -1477,7 +1477,7 @@ override_options (void)
Remove this code in GCC 3.2 or later. */
if (ix86_align_loops_string)
{
warning ("-malign-loops is obsolete, use -falign-loops");
warning (0, "-malign-loops is obsolete, use -falign-loops");
if (align_loops == 0)
{
i = atoi (ix86_align_loops_string);
@ -1490,7 +1490,7 @@ override_options (void)
if (ix86_align_jumps_string)
{
warning ("-malign-jumps is obsolete, use -falign-jumps");
warning (0, "-malign-jumps is obsolete, use -falign-jumps");
if (align_jumps == 0)
{
i = atoi (ix86_align_jumps_string);
@ -1503,7 +1503,7 @@ override_options (void)
if (ix86_align_funcs_string)
{
warning ("-malign-functions is obsolete, use -falign-functions");
warning (0, "-malign-functions is obsolete, use -falign-functions");
if (align_functions == 0)
{
i = atoi (ix86_align_funcs_string);
@ -1641,7 +1641,7 @@ override_options (void)
{
if (!TARGET_SSE)
{
warning ("SSE instruction set disabled, using 387 arithmetics");
warning (0, "SSE instruction set disabled, using 387 arithmetics");
ix86_fpmath = FPMATH_387;
}
else
@ -1652,12 +1652,12 @@ override_options (void)
{
if (!TARGET_SSE)
{
warning ("SSE instruction set disabled, using 387 arithmetics");
warning (0, "SSE instruction set disabled, using 387 arithmetics");
ix86_fpmath = FPMATH_387;
}
else if (!TARGET_80387)
{
warning ("387 instruction set disabled, using SSE arithmetics");
warning (0, "387 instruction set disabled, using SSE arithmetics");
ix86_fpmath = FPMATH_SSE;
}
else
@ -1815,7 +1815,7 @@ ix86_handle_cdecl_attribute (tree *node, tree name,
&& TREE_CODE (*node) != FIELD_DECL
&& TREE_CODE (*node) != TYPE_DECL)
{
warning ("%qs attribute only applies to functions",
warning (0, "%qs attribute only applies to functions",
IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
@ -1843,7 +1843,7 @@ ix86_handle_cdecl_attribute (tree *node, tree name,
if (TARGET_64BIT)
{
warning ("%qs attribute ignored", IDENTIFIER_POINTER (name));
warning (0, "%qs attribute ignored", IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
@ -1861,7 +1861,7 @@ ix86_handle_regparm_attribute (tree *node, tree name, tree args,
&& TREE_CODE (*node) != FIELD_DECL
&& TREE_CODE (*node) != TYPE_DECL)
{
warning ("%qs attribute only applies to functions",
warning (0, "%qs attribute only applies to functions",
IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
@ -1872,13 +1872,13 @@ ix86_handle_regparm_attribute (tree *node, tree name, tree args,
cst = TREE_VALUE (args);
if (TREE_CODE (cst) != INTEGER_CST)
{
warning ("%qs attribute requires an integer constant argument",
warning (0, "%qs attribute requires an integer constant argument",
IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
else if (compare_tree_int (cst, REGPARM_MAX) > 0)
{
warning ("argument to %qs attribute larger than %d",
warning (0, "argument to %qs attribute larger than %d",
IDENTIFIER_POINTER (name), REGPARM_MAX);
*no_add_attrs = true;
}
@ -2990,7 +2990,7 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode orig_mode,
if (!TARGET_SSE && !warnedsse && cum->warn_sse)
{
warnedsse = true;
warning ("SSE vector argument without SSE enabled "
warning (0, "SSE vector argument without SSE enabled "
"changes the ABI");
}
if (cum->sse_nregs)
@ -3007,7 +3007,7 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode orig_mode,
if (!TARGET_MMX && !warnedmmx && cum->warn_mmx)
{
warnedmmx = true;
warning ("MMX vector argument without MMX enabled "
warning (0, "MMX vector argument without MMX enabled "
"changes the ABI");
}
if (cum->mmx_nregs)
@ -3260,7 +3260,7 @@ ix86_struct_value_rtx (tree type, int incoming ATTRIBUTE_UNUSED)
|| (VECTOR_MODE_P (mode) && GET_MODE_SIZE (mode) == 16))
{
warned = true;
warning ("SSE vector return without SSE enabled changes the ABI");
warning (0, "SSE vector return without SSE enabled changes the ABI");
}
}
@ -15988,7 +15988,7 @@ ix86_handle_struct_attribute (tree *node, tree name,
if (!(type && (TREE_CODE (*type) == RECORD_TYPE
|| TREE_CODE (*type) == UNION_TYPE)))
{
warning ("%qs attribute ignored", IDENTIFIER_POINTER (name));
warning (0, "%qs attribute ignored", IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
@ -15997,7 +15997,7 @@ ix86_handle_struct_attribute (tree *node, tree name,
|| ((is_attribute_p ("gcc_struct", name)
&& lookup_attribute ("ms_struct", TYPE_ATTRIBUTES (*type)))))
{
warning ("%qs incompatible attribute ignored",
warning (0, "%qs incompatible attribute ignored",
IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}

View File

@ -71,7 +71,7 @@ ix86_handle_shared_attribute (tree *node, tree name,
{
if (TREE_CODE (*node) != VAR_DECL)
{
warning ("%qs attribute only applies to variables",
warning (0, "%qs attribute only applies to variables",
IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
@ -199,7 +199,7 @@ i386_pe_dllimport_p (tree decl)
{
/* Don't warn about artificial methods. */
if (!DECL_ARTIFICIAL (decl))
warning ("%Jfunction '%D' is defined after prior declaration "
warning (0, "%Jfunction '%D' is defined after prior declaration "
"as dllimport: attribute ignored", decl, decl);
return 0;
}
@ -210,7 +210,7 @@ i386_pe_dllimport_p (tree decl)
else if (TREE_CODE (decl) == FUNCTION_DECL && DECL_INLINE (decl))
{
if (extra_warnings)
warning ("%Jinline function '%D' is declared as dllimport: "
warning (0, "%Jinline function '%D' is declared as dllimport: "
"attribute ignored.", decl, decl);
return 0;
}
@ -279,7 +279,7 @@ i386_pe_mark_dllexport (tree decl)
oldname = XSTR (rtlname, 0);
if (i386_pe_dllimport_name_p (oldname))
{
warning ("%Jinconsistent dll linkage for '%D', dllexport assumed.",
warning (0, "%Jinconsistent dll linkage for '%D', dllexport assumed.",
decl, decl);
/* Remove DLL_IMPORT_PREFIX. */
oldname += strlen (DLL_IMPORT_PREFIX);
@ -463,10 +463,10 @@ i386_pe_encode_section_info (tree decl, rtx rtl, int first)
We leave these alone for now. */
if (DECL_INITIAL (decl) || !DECL_EXTERNAL (decl))
warning ("%J'%D' defined locally after being "
warning (0, "%J'%D' defined locally after being "
"referenced with dllimport linkage", decl, decl);
else
warning ("%J'%D' redeclared without dllimport attribute "
warning (0, "%J'%D' redeclared without dllimport attribute "
"after being referenced with dllimport linkage", decl, decl);
}
}

View File

@ -49,7 +49,7 @@ ia64_hpux_handle_builtin_pragma (cpp_reader *pfile ATTRIBUTE_UNUSED)
type = c_lex (&x);
}
if (type != CPP_EOF)
warning ("malformed #pragma builtin");
warning (0, "malformed #pragma builtin");
}
/* List of standard math functions which do not set matherr by default

View File

@ -482,7 +482,7 @@ ia64_handle_model_attribute (tree *node, tree name, tree args,
}
else
{
warning ("invalid argument of %qs attribute",
warning (0, "invalid argument of %qs attribute",
IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
@ -514,7 +514,7 @@ ia64_handle_model_attribute (tree *node, tree name, tree args,
break;
default:
warning ("%qs attribute ignored", IDENTIFIER_POINTER (name));
warning (0, "%qs attribute ignored", IDENTIFIER_POINTER (name));
*no_add_attrs = true;
break;
}
@ -4548,7 +4548,7 @@ fix_range (const char *const_str)
dash = strchr (str, '-');
if (!dash)
{
warning ("value of -mfixed-range must have form REG1-REG2");
warning (0, "value of -mfixed-range must have form REG1-REG2");
return;
}
*dash = '\0';
@ -4560,14 +4560,14 @@ fix_range (const char *const_str)
first = decode_reg_name (str);
if (first < 0)
{
warning ("unknown register name: %s", str);
warning (0, "unknown register name: %s", str);
return;
}
last = decode_reg_name (dash + 1);
if (last < 0)
{
warning ("unknown register name: %s", dash + 1);
warning (0, "unknown register name: %s", dash + 1);
return;
}
@ -4575,7 +4575,7 @@ fix_range (const char *const_str)
if (first > last)
{
warning ("%s-%s is an empty range", str, dash + 1);
warning (0, "%s-%s is an empty range", str, dash + 1);
return;
}
@ -4656,7 +4656,7 @@ ia64_override_options (void)
if (TARGET_INLINE_SQRT == INL_MIN_LAT)
{
warning ("not yet implemented: latency-optimized inline square root");
warning (0, "not yet implemented: latency-optimized inline square root");
TARGET_INLINE_SQRT = INL_MAX_THR;
}

View File

@ -3154,14 +3154,14 @@ ip2k_handle_progmem_attribute (tree *node, tree name,
{
if (DECL_INITIAL (*node) == NULL_TREE && !DECL_EXTERNAL (*node))
{
warning ("only initialized variables can be placed into "
warning (0, "only initialized variables can be placed into "
"program memory area");
*no_add_attrs = true;
}
}
else
{
warning ("%qs attribute ignored", IDENTIFIER_POINTER (name));
warning (0, "%qs attribute ignored", IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
}
@ -3179,7 +3179,7 @@ ip2k_handle_fndecl_attribute (tree *node, tree name,
{
if (TREE_CODE (*node) != FUNCTION_DECL)
{
warning ("%qs attribute only applies to functions",
warning (0, "%qs attribute only applies to functions",
IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}

View File

@ -387,7 +387,7 @@ m32r_handle_model_attribute (tree *node ATTRIBUTE_UNUSED, tree name,
&& arg != large_ident1
&& arg != large_ident2)
{
warning ("invalid argument of %qs attribute",
warning (0, "invalid argument of %qs attribute",
IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}

View File

@ -284,7 +284,7 @@ m68hc11_override_options (void)
/* Compilation with -fpic generates a wrong code. */
if (flag_pic)
{
warning ("-f%s ignored for 68HC11/68HC12 (not supported)",
warning (0, "-f%s ignored for 68HC11/68HC12 (not supported)",
(flag_pic > 1) ? "PIC" : "pic");
flag_pic = 0;
}
@ -1123,7 +1123,7 @@ m68hc11_handle_page0_attribute (tree *node, tree name,
}
else
{
warning ("%qs attribute ignored", IDENTIFIER_POINTER (name));
warning (0, "%qs attribute ignored", IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
@ -1159,7 +1159,7 @@ m68hc11_handle_fntype_attribute (tree *node, tree name,
&& TREE_CODE (*node) != FIELD_DECL
&& TREE_CODE (*node) != TYPE_DECL)
{
warning ("%qs attribute only applies to functions",
warning (0, "%qs attribute only applies to functions",
IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
@ -1244,13 +1244,13 @@ m68hc11_encode_section_info (tree decl, rtx rtl, int first ATTRIBUTE_UNUSED)
trap_handler = lookup_attribute ("trap", func_attr) != NULL_TREE;
if (trap_handler && is_far)
{
warning ("%<trap%> and %<far%> attributes are not compatible, ignoring %<far%>");
warning (0, "%<trap%> and %<far%> attributes are not compatible, ignoring %<far%>");
trap_handler = 0;
}
if (trap_handler)
{
if (trap_handler_symbol != 0)
warning ("%<trap%> attribute is already used");
warning (0, "%<trap%> attribute is already used");
else
trap_handler_symbol = XEXP (rtl, 0);
}

View File

@ -373,7 +373,7 @@ m68k_handle_fndecl_attribute (tree *node, tree name,
{
if (TREE_CODE (*node) != FUNCTION_DECL)
{
warning ("%qs attribute only applies to functions",
warning (0, "%qs attribute only applies to functions",
IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
@ -632,7 +632,7 @@ m68k_output_function_prologue (FILE *stream, HOST_WIDE_INT size ATTRIBUTE_UNUSED
asm_fprintf (stream, "\tcmp" ASM_DOT "l %s,%Rsp\n\ttrapcs\n",
M68K_REGNAME(REGNO (stack_limit_rtx)));
else if (GET_CODE (stack_limit_rtx) != SYMBOL_REF)
warning ("stack limit expression is not supported");
warning (0, "stack limit expression is not supported");
}
if (current_frame.reg_no <= 2)

View File

@ -3059,7 +3059,7 @@ mcore_handle_naked_attribute (tree * node, tree name, tree args ATTRIBUTE_UNUSED
}
else
{
warning ("%qs attribute only applies to functions",
warning (0, "%qs attribute only applies to functions",
IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}

View File

@ -4350,7 +4350,7 @@ override_options (void)
/* Deprecate -mint64. Remove after 4.0 branches. */
if (TARGET_INT64)
warning ("-mint64 is a deprecated option");
warning (0, "-mint64 is a deprecated option");
if (TARGET_INT64 && !TARGET_LONG64)
error ("unsupported combination: %s", "-mint64 -mlong32");
@ -4404,7 +4404,7 @@ override_options (void)
target_flags &= ~MASK_BRANCHLIKELY;
}
if (TARGET_BRANCHLIKELY && !ISA_HAS_BRANCHLIKELY)
warning ("generation of Branch Likely instructions enabled, but not supported by architecture");
warning (0, "generation of Branch Likely instructions enabled, but not supported by architecture");
/* The effect of -mabicalls isn't defined for the EABI. */
if (mips_abi == ABI_EABI && TARGET_ABICALLS)
@ -4421,7 +4421,7 @@ override_options (void)
{
flag_pic = 1;
if (mips_section_threshold > 0)
warning ("-G is incompatible with PIC code which is the default");
warning (0, "-G is incompatible with PIC code which is the default");
}
/* mips_split_addresses is a half-way house between explicit
@ -9215,7 +9215,7 @@ mips_parse_cpu (const char *cpu_string)
for (s = cpu_string; *s != 0; s++)
if (ISUPPER (*s))
{
warning ("the cpu name must be lower case");
warning (0, "the cpu name must be lower case");
break;
}

View File

@ -226,7 +226,7 @@ mmix_override_options (void)
labels. */
if (flag_pic)
{
warning ("-f%s not supported: ignored", (flag_pic > 1) ? "PIC" : "pic");
warning (0, "-f%s not supported: ignored", (flag_pic > 1) ? "PIC" : "pic");
flag_pic = 0;
}
}

View File

@ -1105,7 +1105,7 @@ ns32k_handle_fntype_attribute (tree *node, tree name,
&& TREE_CODE (*node) != FIELD_DECL
&& TREE_CODE (*node) != TYPE_DECL)
{
warning ("%qs attribute only applies to functions",
warning (0, "%qs attribute only applies to functions",
IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}

View File

@ -79,7 +79,7 @@ Boston, MA 02111-1307, USA. */
builtin_define ("_INCLUDE_XOPEN_SOURCE_500"); \
} \
else if (flag_isoc94 || flag_isoc99 || c_dialect_cxx ()) \
warning ("-munix=98 option required for C89 " \
warning (0, "-munix=98 option required for C89 " \
"Amendment 1 features.\n"); \
} \
if (TARGET_SIO) \

View File

@ -317,7 +317,7 @@ fix_range (const char *const_str)
dash = strchr (str, '-');
if (!dash)
{
warning ("value of -mfixed-range must have form REG1-REG2");
warning (0, "value of -mfixed-range must have form REG1-REG2");
return;
}
*dash = '\0';
@ -329,14 +329,14 @@ fix_range (const char *const_str)
first = decode_reg_name (str);
if (first < 0)
{
warning ("unknown register name: %s", str);
warning (0, "unknown register name: %s", str);
return;
}
last = decode_reg_name (dash + 1);
if (last < 0)
{
warning ("unknown register name: %s", dash + 1);
warning (0, "unknown register name: %s", dash + 1);
return;
}
@ -344,7 +344,7 @@ fix_range (const char *const_str)
if (first > last)
{
warning ("%s-%s is an empty range", str, dash + 1);
warning (0, "%s-%s is an empty range", str, dash + 1);
return;
}
@ -449,18 +449,18 @@ override_options (void)
if (flag_pic && TARGET_PORTABLE_RUNTIME)
{
warning ("PIC code generation is not supported in the portable runtime model\n");
warning (0, "PIC code generation is not supported in the portable runtime model\n");
}
if (flag_pic && TARGET_FAST_INDIRECT_CALLS)
{
warning ("PIC code generation is not compatible with fast indirect calls\n");
warning (0, "PIC code generation is not compatible with fast indirect calls\n");
}
if (! TARGET_GAS && write_symbols != NO_DEBUG)
{
warning ("-g is only supported when using GAS on this processor,");
warning ("-g option disabled");
warning (0, "-g is only supported when using GAS on this processor,");
warning (0, "-g option disabled");
write_symbols = NO_DEBUG;
}
@ -7837,7 +7837,7 @@ pa_asm_output_aligned_common (FILE *stream,
max_common_align = TARGET_64BIT ? 128 : (size >= 4096 ? 256 : 64);
if (align > max_common_align)
{
warning ("alignment (%u) for %s exceeds maximum alignment "
warning (0, "alignment (%u) for %s exceeds maximum alignment "
"for global common data. Using %u",
align / BITS_PER_UNIT, name, max_common_align / BITS_PER_UNIT);
align = max_common_align;

View File

@ -46,12 +46,12 @@ do { \
if (TARGET_64BIT && (target_flags & NON_POWERPC_MASKS)) \
{ \
target_flags &= ~NON_POWERPC_MASKS; \
warning ("-maix64 and POWER architecture are incompatible"); \
warning (0, "-maix64 and POWER architecture are incompatible"); \
} \
if (TARGET_64BIT && ! TARGET_POWERPC64) \
{ \
target_flags |= MASK_POWERPC64; \
warning ("-maix64 requires PowerPC64 architecture remain enabled"); \
warning (0, "-maix64 requires PowerPC64 architecture remain enabled"); \
} \
if (TARGET_POWERPC64 && ! TARGET_64BIT) \
{ \

View File

@ -45,12 +45,12 @@ do { \
if (TARGET_64BIT && (target_flags & NON_POWERPC_MASKS)) \
{ \
target_flags &= ~NON_POWERPC_MASKS; \
warning ("-maix64 and POWER architecture are incompatible"); \
warning (0, "-maix64 and POWER architecture are incompatible"); \
} \
if (TARGET_64BIT && ! TARGET_POWERPC64) \
{ \
target_flags |= MASK_POWERPC64; \
warning ("-maix64 requires PowerPC64 architecture remain enabled"); \
warning (0, "-maix64 requires PowerPC64 architecture remain enabled"); \
} \
if (TARGET_POWERPC64 && ! TARGET_64BIT) \
{ \

View File

@ -45,12 +45,12 @@ do { \
if (TARGET_64BIT && (target_flags & NON_POWERPC_MASKS)) \
{ \
target_flags &= ~NON_POWERPC_MASKS; \
warning ("-maix64 and POWER architecture are incompatible"); \
warning (0, "-maix64 and POWER architecture are incompatible"); \
} \
if (TARGET_64BIT && ! TARGET_POWERPC64) \
{ \
target_flags |= MASK_POWERPC64; \
warning ("-maix64 requires PowerPC64 architecture remain enabled"); \
warning (0, "-maix64 requires PowerPC64 architecture remain enabled"); \
} \
if (TARGET_POWERPC64 && ! TARGET_64BIT) \
{ \

View File

@ -86,20 +86,20 @@ do { \
if (MACHO_DYNAMIC_NO_PIC_P) \
{ \
if (flag_pic) \
warning ("-mdynamic-no-pic overrides -fpic or -fPIC"); \
warning (0, "-mdynamic-no-pic overrides -fpic or -fPIC"); \
flag_pic = 0; \
} \
else if (flag_pic == 1) \
{ \
/* Darwin doesn't support -fpic. */ \
warning ("-fpic is not supported; -fPIC assumed"); \
warning (0, "-fpic is not supported; -fPIC assumed"); \
flag_pic = 2; \
} \
} \
if (TARGET_64BIT && ! TARGET_POWERPC64) \
{ \
target_flags |= MASK_POWERPC64; \
warning ("-m64 requires PowerPC64 architecture, enabling"); \
warning (0, "-m64 requires PowerPC64 architecture, enabling"); \
} \
} while(0)

View File

@ -42,8 +42,8 @@
attribute by default. */
#define SYNTAX_ERROR(msgid) do { \
warning (msgid); \
warning ("ignoring malformed #pragma longcall"); \
warning (0, msgid); \
warning (0, "ignoring malformed #pragma longcall"); \
return; \
} while (0)
@ -66,7 +66,7 @@ rs6000_pragma_longcall (cpp_reader *pfile ATTRIBUTE_UNUSED)
SYNTAX_ERROR ("number must be 0 or 1");
if (c_lex (&x) != CPP_EOF)
warning ("junk at end of #pragma longcall");
warning (0, "junk at end of #pragma longcall");
rs6000_default_long_calls = (n == integer_one_node);
}

View File

@ -1251,14 +1251,14 @@ rs6000_override_options (const char *default_cpu)
{
target_flags &= ~MASK_MULTIPLE;
if ((target_flags_explicit & MASK_MULTIPLE) != 0)
warning ("-mmultiple is not supported on little endian systems");
warning (0, "-mmultiple is not supported on little endian systems");
}
if (TARGET_STRING)
{
target_flags &= ~MASK_STRING;
if ((target_flags_explicit & MASK_STRING) != 0)
warning ("-mstring is not supported on little endian systems");
warning (0, "-mstring is not supported on little endian systems");
}
}
@ -1647,12 +1647,12 @@ rs6000_parse_abi_options (void)
else if (! strcmp (rs6000_abi_string, "d64"))
{
rs6000_darwin64_abi = 1;
warning ("Using darwin64 ABI");
warning (0, "Using darwin64 ABI");
}
else if (! strcmp (rs6000_abi_string, "d32"))
{
rs6000_darwin64_abi = 0;
warning ("Using old darwin ABI");
warning (0, "Using old darwin ABI");
}
else if (! strcmp (rs6000_abi_string, "no-spe"))
@ -1691,7 +1691,7 @@ rs6000_parse_alignment_option (void)
useful for performance studies from time to time though, so
don't disable it entirely. */
if (DEFAULT_ABI == ABI_DARWIN && TARGET_64BIT)
warning ("-malign-power is not supported for 64-bit Darwin;"
warning (0, "-malign-power is not supported for 64-bit Darwin;"
" it is incompatible with the installed C and C++ libraries");
rs6000_alignment_flags = MASK_ALIGN_POWER;
}
@ -3857,7 +3857,7 @@ rs6000_return_in_memory (tree type, tree fntype ATTRIBUTE_UNUSED)
static bool warned_for_return_big_vectors = false;
if (!warned_for_return_big_vectors)
{
warning ("GCC vector returned by reference: "
warning (0, "GCC vector returned by reference: "
"non-standard ABI extension with no compatibility guarantee");
warned_for_return_big_vectors = true;
}
@ -5028,7 +5028,7 @@ rs6000_pass_by_reference (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED,
fprintf (stderr, "function_arg_pass_by_reference: synthetic vector\n");
if (!warned_for_pass_big_vectors)
{
warning ("GCC vector passed by reference: "
warning (0, "GCC vector passed by reference: "
"non-standard ABI extension with no compatibility guarantee");
warned_for_pass_big_vectors = true;
}
@ -12408,7 +12408,7 @@ rs6000_emit_allocate_stack (HOST_WIDE_INT size, int copy_r12)
if (INTVAL (todec) != -size)
{
warning ("stack frame too large");
warning (0, "stack frame too large");
emit_insn (gen_trap ());
return;
}
@ -12445,7 +12445,7 @@ rs6000_emit_allocate_stack (HOST_WIDE_INT size, int copy_r12)
const0_rtx));
}
else
warning ("stack limit expression is not supported");
warning (0, "stack limit expression is not supported");
}
if (copy_r12 || ! TARGET_UPDATE)
@ -14927,7 +14927,7 @@ output_function_profiler (FILE *file, int labelno)
save_lr = 4;
if (!TARGET_32BIT)
{
warning ("no profiling of 64-bit code for this ABI");
warning (0, "no profiling of 64-bit code for this ABI");
return;
}
ASM_GENERATE_INTERNAL_LABEL (buf, "LP", labelno);
@ -16019,7 +16019,7 @@ rs6000_handle_altivec_attribute (tree *node,
if (TARGET_64BIT)
error ("use of %<long%> in AltiVec types is invalid for 64-bit code");
else if (rs6000_warn_altivec_long)
warning ("use of %<long%> in AltiVec types is deprecated; use %<int%>");
warning (0, "use of %<long%> in AltiVec types is deprecated; use %<int%>");
}
else if (type == long_long_unsigned_type_node
|| type == long_long_integer_type_node)
@ -16114,7 +16114,7 @@ rs6000_handle_longcall_attribute (tree *node, tree name,
&& TREE_CODE (*node) != FIELD_DECL
&& TREE_CODE (*node) != TYPE_DECL)
{
warning ("%qs attribute only applies to functions",
warning (0, "%qs attribute only applies to functions",
IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}

View File

@ -6648,11 +6648,11 @@ s390_emit_prologue (void)
if (s390_warn_framesize > 0
&& cfun_frame_layout.frame_size >= s390_warn_framesize)
warning ("frame size of %qs is " HOST_WIDE_INT_PRINT_DEC " bytes",
warning (0, "frame size of %qs is " HOST_WIDE_INT_PRINT_DEC " bytes",
current_function_name (), cfun_frame_layout.frame_size);
if (s390_warn_dynamicstack_p && cfun->calls_alloca)
warning ("%qs uses dynamic stack allocation", current_function_name ());
warning (0, "%qs uses dynamic stack allocation", current_function_name ());
/* Save incoming stack pointer into temp reg. */
if (TARGET_BACKCHAIN || next_fpr)

View File

@ -7185,7 +7185,7 @@ sh_handle_interrupt_handler_attribute (tree *node, tree name,
{
if (TREE_CODE (*node) != FUNCTION_DECL)
{
warning ("%qs attribute only applies to functions",
warning (0, "%qs attribute only applies to functions",
IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
@ -7206,21 +7206,21 @@ sh_handle_sp_switch_attribute (tree *node, tree name, tree args,
{
if (TREE_CODE (*node) != FUNCTION_DECL)
{
warning ("%qs attribute only applies to functions",
warning (0, "%qs attribute only applies to functions",
IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
else if (!pragma_interrupt)
{
/* The sp_switch attribute only has meaning for interrupt functions. */
warning ("%qs attribute only applies to interrupt functions",
warning (0, "%qs attribute only applies to interrupt functions",
IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
else if (TREE_CODE (TREE_VALUE (args)) != STRING_CST)
{
/* The argument must be a constant string. */
warning ("%qs attribute argument not a string constant",
warning (0, "%qs attribute argument not a string constant",
IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
@ -7241,21 +7241,21 @@ sh_handle_trap_exit_attribute (tree *node, tree name, tree args,
{
if (TREE_CODE (*node) != FUNCTION_DECL)
{
warning ("%qs attribute only applies to functions",
warning (0, "%qs attribute only applies to functions",
IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
else if (!pragma_interrupt)
{
/* The trap_exit attribute only has meaning for interrupt functions. */
warning ("%qs attribute only applies to interrupt functions",
warning (0, "%qs attribute only applies to interrupt functions",
IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
else if (TREE_CODE (TREE_VALUE (args)) != INTEGER_CST)
{
/* The argument must be a constant integer. */
warning ("%qs attribute argument not an integer constant",
warning (0, "%qs attribute argument not an integer constant",
IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}

View File

@ -751,7 +751,7 @@ do { \
here we have a working libgcov, so just assume that we have. */\
if (profile_flag) \
{ \
warning ("Profiling is not supported on this target."); \
warning (0, "Profiling is not supported on this target."); \
profile_flag = profile_arc_flag = 0; \
} \
} \

View File

@ -144,7 +144,7 @@ sh_symbian_dllimport_p (tree decl)
{
/* Don't warn about artificial methods. */
if (!DECL_ARTIFICIAL (decl))
warning ("%H function '%D' is defined after prior declaration as dllimport: attribute ignored",
warning (0, "%H function '%D' is defined after prior declaration as dllimport: attribute ignored",
& DECL_SOURCE_LOCATION (decl), decl);
return false;
}
@ -155,7 +155,7 @@ sh_symbian_dllimport_p (tree decl)
else if (TREE_CODE (decl) == FUNCTION_DECL && DECL_INLINE (decl))
{
if (extra_warnings)
warning ("%Hinline function '%D' is declared as dllimport: attribute ignored.",
warning (0, "%Hinline function '%D' is declared as dllimport: attribute ignored.",
& DECL_SOURCE_LOCATION (decl), decl);
return false;
}
@ -329,7 +329,7 @@ sh_symbian_encode_section_info (tree decl, rtx rtl, int first)
tree idp = get_identifier (oldname + strlen (DLL_IMPORT_PREFIX));
rtx newrtl = gen_rtx_SYMBOL_REF (Pmode, IDENTIFIER_POINTER (idp));
warning ("%H%s '%D' %s after being referenced with dllimport linkage.",
warning (0, "%H%s '%D' %s after being referenced with dllimport linkage.",
& DECL_SOURCE_LOCATION (decl),
TREE_CODE (decl) == VAR_DECL ? "variable" : "function",
decl, (DECL_INITIAL (decl) || !DECL_EXTERNAL (decl))
@ -411,14 +411,14 @@ sh_symbian_handle_dll_attribute (tree *pnode, tree name, tree args,
| (int) ATTR_FLAG_FUNCTION_NEXT
| (int) ATTR_FLAG_ARRAY_NEXT))
{
warning ("%qs attribute ignored", attr);
warning (0, "%qs attribute ignored", attr);
*no_add_attrs = true;
return tree_cons (name, args, NULL_TREE);
}
if (TREE_CODE (node) != RECORD_TYPE && TREE_CODE (node) != UNION_TYPE)
{
warning ("%qs attribute ignored", attr);
warning (0, "%qs attribute ignored", attr);
*no_add_attrs = true;
}

View File

@ -91,7 +91,7 @@ solaris_pragma_align (cpp_reader *pfile ATTRIBUTE_UNUSED)
if (c_lex (&x) != CPP_NUMBER
|| c_lex (&t) != CPP_OPEN_PAREN)
{
warning ("malformed %<#pragma align%>, ignoring");
warning (0, "malformed %<#pragma align%>, ignoring");
return;
}
@ -100,14 +100,14 @@ solaris_pragma_align (cpp_reader *pfile ATTRIBUTE_UNUSED)
|| (low != 1 && low != 2 && low != 4 && low != 8 && low != 16
&& low != 32 && low != 64 && low != 128))
{
warning ("invalid alignment for %<#pragma align%>, ignoring");
warning (0, "invalid alignment for %<#pragma align%>, ignoring");
return;
}
ttype = c_lex (&t);
if (ttype != CPP_NAME)
{
warning ("malformed %<#pragma align%>, ignoring");
warning (0, "malformed %<#pragma align%>, ignoring");
return;
}
@ -115,7 +115,7 @@ solaris_pragma_align (cpp_reader *pfile ATTRIBUTE_UNUSED)
{
tree decl = identifier_global_value (t);
if (decl && DECL_P (decl))
warning ("%<#pragma align%> must appear before the declaration of "
warning (0, "%<#pragma align%> must appear before the declaration of "
"%D, ignoring", decl);
else
solaris_pending_aligns = tree_cons (t, build_tree_list (NULL, x),
@ -127,19 +127,19 @@ solaris_pragma_align (cpp_reader *pfile ATTRIBUTE_UNUSED)
ttype = c_lex (&t);
if (ttype != CPP_NAME)
{
warning ("malformed %<#pragma align%>");
warning (0, "malformed %<#pragma align%>");
return;
}
}
else if (ttype == CPP_CLOSE_PAREN)
{
if (c_lex (&t) != CPP_EOF)
warning ("junk at end of %<#pragma align%>");
warning (0, "junk at end of %<#pragma align%>");
return;
}
else
{
warning ("malformed %<#pragma align%>");
warning (0, "malformed %<#pragma align%>");
return;
}
}
@ -155,14 +155,14 @@ solaris_pragma_init (cpp_reader *pfile ATTRIBUTE_UNUSED)
if (c_lex (&t) != CPP_OPEN_PAREN)
{
warning ("malformed %<#pragma init%>, ignoring");
warning (0, "malformed %<#pragma init%>, ignoring");
return;
}
ttype = c_lex (&t);
if (ttype != CPP_NAME)
{
warning ("malformed %<#pragma init%>, ignoring");
warning (0, "malformed %<#pragma init%>, ignoring");
return;
}
@ -185,19 +185,19 @@ solaris_pragma_init (cpp_reader *pfile ATTRIBUTE_UNUSED)
ttype = c_lex (&t);
if (ttype != CPP_NAME)
{
warning ("malformed %<#pragma init%>");
warning (0, "malformed %<#pragma init%>");
return;
}
}
else if (ttype == CPP_CLOSE_PAREN)
{
if (c_lex (&t) != CPP_EOF)
warning ("junk at end of %<#pragma init%>");
warning (0, "junk at end of %<#pragma init%>");
return;
}
else
{
warning ("malformed %<#pragma init%>");
warning (0, "malformed %<#pragma init%>");
return;
}
}
@ -213,14 +213,14 @@ solaris_pragma_fini (cpp_reader *pfile ATTRIBUTE_UNUSED)
if (c_lex (&t) != CPP_OPEN_PAREN)
{
warning ("malformed %<#pragma fini%>, ignoring");
warning (0, "malformed %<#pragma fini%>, ignoring");
return;
}
ttype = c_lex (&t);
if (ttype != CPP_NAME)
{
warning ("malformed %<#pragma fini%>, ignoring");
warning (0, "malformed %<#pragma fini%>, ignoring");
return;
}
@ -243,19 +243,19 @@ solaris_pragma_fini (cpp_reader *pfile ATTRIBUTE_UNUSED)
ttype = c_lex (&t);
if (ttype != CPP_NAME)
{
warning ("malformed %<#pragma fini%>");
warning (0, "malformed %<#pragma fini%>");
return;
}
}
else if (ttype == CPP_CLOSE_PAREN)
{
if (c_lex (&t) != CPP_EOF)
warning ("junk at end of %<#pragma fini%>");
warning (0, "junk at end of %<#pragma fini%>");
return;
}
else
{
warning ("malformed %<#pragma fini%>");
warning (0, "malformed %<#pragma fini%>");
return;
}
}

View File

@ -51,7 +51,7 @@ solaris_insert_attributes (tree decl, tree *attributes)
{
if (lookup_attribute ("aligned", DECL_ATTRIBUTES (decl))
|| lookup_attribute ("aligned", *attributes))
warning ("%Jignoring %<#pragma align%> for explicitly "
warning (0, "%Jignoring %<#pragma align%> for explicitly "
"aligned %<%D%>", decl, decl);
else
*attributes = tree_cons (get_identifier ("aligned"), value,

View File

@ -2293,7 +2293,7 @@ xstormy16_handle_interrupt_attribute (tree *node, tree name,
{
if (TREE_CODE (*node) != FUNCTION_TYPE)
{
warning ("%qs attribute only applies to functions",
warning (0, "%qs attribute only applies to functions",
IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
@ -2314,14 +2314,14 @@ xstormy16_handle_below100_attribute (tree *node,
&& TREE_CODE (*node) != POINTER_TYPE
&& TREE_CODE (*node) != TYPE_DECL)
{
warning ("%<__BELOW100__%> attribute only applies to variables");
warning (0, "%<__BELOW100__%> attribute only applies to variables");
*no_add_attrs = true;
}
else if (args == NULL_TREE && TREE_CODE (*node) == VAR_DECL)
{
if (! (TREE_PUBLIC (*node) || TREE_STATIC (*node)))
{
warning ("__BELOW100__ attribute not allowed with auto storage class.");
warning (0, "__BELOW100__ attribute not allowed with auto storage class.");
*no_add_attrs = true;
}
}

View File

@ -64,9 +64,9 @@ static int
pop_data_area (v850_data_area data_area)
{
if (data_area_stack == NULL)
warning ("#pragma GHS endXXXX found without previous startXXX");
warning (0, "#pragma GHS endXXXX found without previous startXXX");
else if (data_area != data_area_stack->data_area)
warning ("#pragma GHS endXXX does not match previous startXXX");
warning (0, "#pragma GHS endXXX does not match previous startXXX");
else
{
data_area_stack_element * elem;
@ -91,7 +91,7 @@ mark_current_function_as_interrupt (void)
if (current_function_decl == NULL_TREE)
{
warning ("cannot set interrupt attribute: no current function");
warning (0, "cannot set interrupt attribute: no current function");
return;
}
@ -99,7 +99,7 @@ mark_current_function_as_interrupt (void)
if (name == NULL_TREE || TREE_CODE (name) != IDENTIFIER_NODE)
{
warning ("cannot set interrupt attribute: no such identifier");
warning (0, "cannot set interrupt attribute: no such identifier");
return;
}
@ -144,7 +144,7 @@ ghs_pragma_section (cpp_reader * pfile ATTRIBUTE_UNUSED)
if (type == CPP_COMMA)
repeat = 1;
else if (type != CPP_EOF)
warning ("junk at end of #pragma ghs section");
warning (0, "junk at end of #pragma ghs section");
if (streq (sect, "data")) kind = GHS_SECTION_KIND_DATA;
else if (streq (sect, "text")) kind = GHS_SECTION_KIND_TEXT;
@ -161,7 +161,7 @@ ghs_pragma_section (cpp_reader * pfile ATTRIBUTE_UNUSED)
else if (streq (sect, "zbss")) kind = GHS_SECTION_KIND_ZDATA;
else
{
warning ("unrecognized section name \"%s\"", sect);
warning (0, "unrecognized section name \"%s\"", sect);
return;
}
@ -176,7 +176,7 @@ ghs_pragma_section (cpp_reader * pfile ATTRIBUTE_UNUSED)
return;
bad:
warning ("malformed #pragma ghs section");
warning (0, "malformed #pragma ghs section");
return;
reset:
@ -195,7 +195,7 @@ ghs_pragma_interrupt (cpp_reader * pfile ATTRIBUTE_UNUSED)
tree x;
if (c_lex (&x) != CPP_EOF)
warning ("junk at end of #pragma ghs interrupt");
warning (0, "junk at end of #pragma ghs interrupt");
mark_current_function_as_interrupt ();
}
@ -206,7 +206,7 @@ ghs_pragma_starttda (cpp_reader * pfile ATTRIBUTE_UNUSED)
tree x;
if (c_lex (&x) != CPP_EOF)
warning ("junk at end of #pragma ghs starttda");
warning (0, "junk at end of #pragma ghs starttda");
push_data_area (DATA_AREA_TDA);
}
@ -217,7 +217,7 @@ ghs_pragma_startsda (cpp_reader * pfile ATTRIBUTE_UNUSED)
tree x;
if (c_lex (&x) != CPP_EOF)
warning ("junk at end of #pragma ghs startsda");
warning (0, "junk at end of #pragma ghs startsda");
push_data_area (DATA_AREA_SDA);
}
@ -228,7 +228,7 @@ ghs_pragma_startzda (cpp_reader * pfile ATTRIBUTE_UNUSED)
tree x;
if (c_lex (&x) != CPP_EOF)
warning ("junk at end of #pragma ghs startzda");
warning (0, "junk at end of #pragma ghs startzda");
push_data_area (DATA_AREA_ZDA);
}
@ -239,7 +239,7 @@ ghs_pragma_endtda (cpp_reader * pfile ATTRIBUTE_UNUSED)
tree x;
if (c_lex (&x) != CPP_EOF)
warning ("junk at end of #pragma ghs endtda");
warning (0, "junk at end of #pragma ghs endtda");
pop_data_area (DATA_AREA_TDA);
}
@ -250,7 +250,7 @@ ghs_pragma_endsda (cpp_reader * pfile ATTRIBUTE_UNUSED)
tree x;
if (c_lex (&x) != CPP_EOF)
warning ("junk at end of #pragma ghs endsda");
warning (0, "junk at end of #pragma ghs endsda");
pop_data_area (DATA_AREA_SDA);
}
@ -261,7 +261,7 @@ ghs_pragma_endzda (cpp_reader * pfile ATTRIBUTE_UNUSED)
tree x;
if (c_lex (&x) != CPP_EOF)
warning ("junk at end of #pragma ghs endzda");
warning (0, "junk at end of #pragma ghs endzda");
pop_data_area (DATA_AREA_ZDA);
}

View File

@ -2102,7 +2102,7 @@ v850_handle_interrupt_attribute (tree * node,
{
if (TREE_CODE (*node) != FUNCTION_DECL)
{
warning ("%qs attribute only applies to functions",
warning (0, "%qs attribute only applies to functions",
IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}

View File

@ -2413,7 +2413,7 @@ xtensa_multibss_section_type_flags (tree decl, const char *name, int reloc)
&& DECL_INITIAL (decl) == NULL_TREE))
flags |= SECTION_BSS; /* @nobits */
else
warning ("only uninitialized variables can be placed in a "
warning (0, "only uninitialized variables can be placed in a "
".bss section");
}

View File

@ -180,7 +180,7 @@ read_counts_file (void)
if (!gcov_magic (gcov_read_unsigned (), GCOV_DATA_MAGIC))
{
warning ("%qs is not a gcov data file", da_file_name);
warning (0, "%qs is not a gcov data file", da_file_name);
gcov_close ();
return;
}
@ -191,7 +191,7 @@ read_counts_file (void)
GCOV_UNSIGNED2STRING (v, tag);
GCOV_UNSIGNED2STRING (e, GCOV_VERSION);
warning ("%qs is version %q.*s, expected version %q.*s",
warning (0, "%qs is version %q.*s, expected version %q.*s",
da_file_name, 4, v, 4, e);
gcov_close ();
return;
@ -345,7 +345,7 @@ get_coverage_counts (unsigned counter, unsigned expected,
entry = htab_find (counts_hash, &elt);
if (!entry)
{
warning ("no coverage for function %qs found.", IDENTIFIER_POINTER
warning (0, "no coverage for function %qs found.", IDENTIFIER_POINTER
(DECL_ASSEMBLER_NAME (current_function_decl)));
return 0;
}
@ -581,7 +581,7 @@ coverage_end_function (void)
if (bbg_file_opened > 1 && gcov_is_error ())
{
warning ("error writing %qs", bbg_file_name);
warning (0, "error writing %qs", bbg_file_name);
bbg_file_opened = -1;
}

View File

@ -1,3 +1,10 @@
2005-04-23 DJ Delorie <dj@redhat.com>
* call.c, class.c, cvt.c, decl.c, decl2.c, except.c, friend.c,
init.c, lex.c, mangle.c, method.c, name-lookup.c, parser.c,
repo.c, rtti.c, tree.c, typeck.c, typeck2.c: Adjust warning()
callers.
2005-04-22 Per Bothner <per@bothner.com>
* decl.c (make_rtl_for_nonlocal_decl): Don't try get_fileinfo if

View File

@ -3402,14 +3402,14 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3)
if (TREE_CODE (arg2_type) == ENUMERAL_TYPE
&& TREE_CODE (arg3_type) == ENUMERAL_TYPE)
warning ("enumeral mismatch in conditional expression: %qT vs %qT",
warning (0, "enumeral mismatch in conditional expression: %qT vs %qT",
arg2_type, arg3_type);
else if (extra_warnings
&& ((TREE_CODE (arg2_type) == ENUMERAL_TYPE
&& !same_type_p (arg3_type, type_promotes_to (arg2_type)))
|| (TREE_CODE (arg3_type) == ENUMERAL_TYPE
&& !same_type_p (arg2_type, type_promotes_to (arg3_type)))))
warning ("enumeral and non-enumeral type in conditional expression");
warning (0, "enumeral and non-enumeral type in conditional expression");
arg2 = perform_implicit_conversion (result_type, arg2);
arg3 = perform_implicit_conversion (result_type, arg3);
@ -3776,7 +3776,7 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3,
&& (TYPE_MAIN_VARIANT (TREE_TYPE (arg1))
!= TYPE_MAIN_VARIANT (TREE_TYPE (arg2))))
{
warning ("comparison between %q#T and %q#T",
warning (0, "comparison between %q#T and %q#T",
TREE_TYPE (arg1), TREE_TYPE (arg2));
}
break;
@ -4097,7 +4097,7 @@ build_temp (tree expr, tree type, int flags,
build_tree_list (NULL_TREE, expr),
type, flags);
if (warningcount > savew)
*diagnostic_fn = warning;
*diagnostic_fn = warning0;
else if (errorcount > savee)
*diagnostic_fn = error;
else
@ -4160,10 +4160,10 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
if (ARITHMETIC_TYPE_P (t) && expr == null_node)
{
if (fn)
warning ("passing NULL to non-pointer argument %P of %qD",
warning (0, "passing NULL to non-pointer argument %P of %qD",
argnum, fn);
else
warning ("converting to non-pointer type %qT from NULL", t);
warning (0, "converting to non-pointer type %qT from NULL", t);
}
/* Warn about assigning a floating-point type to an integer type. */
@ -4171,10 +4171,10 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
&& TREE_CODE (t) == INTEGER_TYPE)
{
if (fn)
warning ("passing %qT for argument %P to %qD",
warning (0, "passing %qT for argument %P to %qD",
TREE_TYPE (expr), argnum, fn);
else
warning ("converting to %qT from %qT", t, TREE_TYPE (expr));
warning (0, "converting to %qT from %qT", t, TREE_TYPE (expr));
}
/* And warn about assigning a negative value to an unsigned
variable. */
@ -4183,10 +4183,10 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
if (TREE_CODE (expr) == INTEGER_CST && TREE_NEGATED_INT (expr))
{
if (fn)
warning ("passing negative value %qE for argument %P to %qD",
warning (0, "passing negative value %qE for argument %P to %qD",
expr, argnum, fn);
else
warning ("converting negative value %qE to %qT", expr, t);
warning (0, "converting negative value %qE to %qT", expr, t);
}
overflow_warning (expr);
@ -4443,7 +4443,7 @@ convert_arg_to_ellipsis (tree arg)
there is no need to emit a warning, since the expression won't be
evaluated. We keep the builtin_trap just as a safety check. */
if (!skip_evaluation)
warning ("cannot pass objects of non-POD type %q#T through %<...%>; "
warning (0, "cannot pass objects of non-POD type %q#T through %<...%>; "
"call will abort at runtime", TREE_TYPE (arg));
arg = call_builtin_trap ();
arg = build2 (COMPOUND_EXPR, integer_type_node, arg,
@ -4469,7 +4469,7 @@ build_x_va_arg (tree expr, tree type)
if (! pod_type_p (type))
{
/* Undefined behavior [expr.call] 5.2.2/7. */
warning ("cannot receive objects of non-POD type %q#T through %<...%>; "
warning (0, "cannot receive objects of non-POD type %q#T through %<...%>; "
"call will abort at runtime", type);
expr = convert (build_pointer_type (type), null_node);
expr = build2 (COMPOUND_EXPR, TREE_TYPE (expr),
@ -5384,7 +5384,7 @@ build_new_method_call (tree instance, tree fns, tree args,
|| DECL_DESTRUCTOR_P (current_function_decl)))
/* This is not an error, it is runtime undefined
behavior. */
warning ((DECL_CONSTRUCTOR_P (current_function_decl) ?
warning (0, (DECL_CONSTRUCTOR_P (current_function_decl) ?
"abstract virtual %q#D called from constructor"
: "abstract virtual %q#D called from destructor"),
cand->fn);
@ -5997,9 +5997,9 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn)
if (warn)
{
warning ("passing %qT chooses %qT over %qT",
warning (0, "passing %qT chooses %qT over %qT",
type, type1, type2);
warning (" in call to %qD", w->fn);
warning (0, " in call to %qD", w->fn);
}
else
add_warning (w, l);
@ -6056,10 +6056,10 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn)
tree source = source_type (w->convs[0]);
if (! DECL_CONSTRUCTOR_P (w->fn))
source = TREE_TYPE (source);
warning ("choosing %qD over %qD", w->fn, l->fn);
warning (" for conversion from %qT to %qT",
warning (0, "choosing %qD over %qD", w->fn, l->fn);
warning (0, " for conversion from %qT to %qT",
source, w->second_conv->type);
warning (" because conversion sequence for the argument is better");
warning (0, " because conversion sequence for the argument is better");
}
else
add_warning (w, l);

View File

@ -1234,7 +1234,7 @@ check_bases (tree t,
here because the case of virtual functions but non-virtual
dtor is handled in finish_struct_1. */
if (warn_ecpp && ! TYPE_POLYMORPHIC_P (basetype))
warning ("base class %q#T has a non-virtual destructor", basetype);
warning (0, "base class %q#T has a non-virtual destructor", basetype);
/* If the base class doesn't have copy constructors or
assignment operators that take const references, then the
@ -1548,7 +1548,7 @@ maybe_warn_about_overly_private_class (tree t)
}
if (!has_nonprivate_method)
{
warning ("all member functions in class %qT are private", t);
warning (0, "all member functions in class %qT are private", t);
return;
}
}
@ -1559,7 +1559,7 @@ maybe_warn_about_overly_private_class (tree t)
fn = CLASSTYPE_DESTRUCTORS (t);
if (fn && TREE_PRIVATE (fn))
{
warning ("%q#T only defines a private destructor and has no friends",
warning (0, "%q#T only defines a private destructor and has no friends",
t);
return;
}
@ -1599,7 +1599,7 @@ maybe_warn_about_overly_private_class (tree t)
if (nonprivate_ctor == 0)
{
warning ("%q#T only defines private constructors and has no friends",
warning (0, "%q#T only defines private constructors and has no friends",
t);
return;
}
@ -3035,16 +3035,16 @@ check_field_decls (tree t, tree *access_decls,
&& TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t)
&& !(TYPE_HAS_INIT_REF (t) && TYPE_HAS_ASSIGN_REF (t)))
{
warning ("%q#T has pointer data members", t);
warning (0, "%q#T has pointer data members", t);
if (! TYPE_HAS_INIT_REF (t))
{
warning (" but does not override %<%T(const %T&)%>", t, t);
warning (0, " but does not override %<%T(const %T&)%>", t, t);
if (! TYPE_HAS_ASSIGN_REF (t))
warning (" or %<operator=(const %T&)%>", t);
warning (0, " or %<operator=(const %T&)%>", t);
}
else if (! TYPE_HAS_ASSIGN_REF (t))
warning (" but does not override %<operator=(const %T&)%>", t);
warning (0, " but does not override %<operator=(const %T&)%>", t);
}
@ -3477,7 +3477,7 @@ layout_empty_base (tree binfo, tree eoc, splay_tree offsets)
propagate_binfo_offsets
(binfo, size_diffop (size_zero_node, BINFO_OFFSET (binfo)));
else if (warn_abi)
warning ("offset of empty base %qT may not be ABI-compliant and may"
warning (0, "offset of empty base %qT may not be ABI-compliant and may"
"change in a future version of GCC",
BINFO_TYPE (binfo));
}
@ -3589,7 +3589,7 @@ build_base_field (record_layout_info rli, tree binfo,
if (abi_version_at_least (2))
CLASSTYPE_NEARLY_EMPTY_P (t) = 0;
else if (warn_abi)
warning ("class %qT will be considered nearly empty in a "
warning (0, "class %qT will be considered nearly empty in a "
"future version of GCC", t);
}
}
@ -4334,7 +4334,7 @@ layout_virtual_bases (record_layout_info rli, splay_tree offsets)
CLASSTYPE_ALIGN (basetype)),
bitsize_unit_node),
BINFO_OFFSET (vbase))))
warning ("offset of virtual base %qT is not ABI-compliant and "
warning (0, "offset of virtual base %qT is not ABI-compliant and "
"may change in a future version of GCC",
basetype);
@ -4433,7 +4433,7 @@ warn_about_ambiguous_bases (tree t)
basetype = BINFO_TYPE (base_binfo);
if (!lookup_base (t, basetype, ba_unique | ba_quiet, NULL))
warning ("direct base %qT inaccessible in %qT due to ambiguity",
warning (0, "direct base %qT inaccessible in %qT due to ambiguity",
basetype, t);
}
@ -4445,7 +4445,7 @@ warn_about_ambiguous_bases (tree t)
basetype = BINFO_TYPE (binfo);
if (!lookup_base (t, basetype, ba_unique | ba_quiet, NULL))
warning ("virtual base %qT inaccessible in %qT due to ambiguity",
warning (0, "virtual base %qT inaccessible in %qT due to ambiguity",
basetype, t);
}
}
@ -4622,7 +4622,7 @@ layout_class_type (tree t, tree *virtuals_p)
else
{
if (warn_abi && TREE_CODE (t) == UNION_TYPE)
warning ("size assigned to %qT may not be "
warning (0, "size assigned to %qT may not be "
"ABI-compliant and may change in a future "
"version of GCC",
t);
@ -4661,7 +4661,7 @@ layout_class_type (tree t, tree *virtuals_p)
&& DECL_MODE (field) != TYPE_MODE (type))
/* Versions of G++ before G++ 3.4 did not reset the
DECL_MODE. */
warning ("the offset of %qD may not be ABI-compliant and may "
warning (0, "the offset of %qD may not be ABI-compliant and may "
"change in a future version of GCC", field);
}
else
@ -4754,7 +4754,7 @@ layout_class_type (tree t, tree *virtuals_p)
TYPE_SIZE (base_t) = bitsize_zero_node;
TYPE_SIZE_UNIT (base_t) = size_zero_node;
if (warn_abi && !integer_zerop (rli_size_unit_so_far (rli)))
warning ("layout of classes derived from empty class %qT "
warning (0, "layout of classes derived from empty class %qT "
"may change in a future version of GCC",
t);
}
@ -5045,7 +5045,7 @@ finish_struct_1 (tree t)
&& (!TREE_PRIVATE (dtor)
|| CLASSTYPE_FRIEND_CLASSES (t)
|| DECL_FRIENDLIST (TYPE_MAIN_DECL (t)))))
warning ("%q#T has virtual functions but non-virtual destructor",
warning (0, "%q#T has virtual functions but non-virtual destructor",
t);
}

View File

@ -194,7 +194,7 @@ cp_convert_to_pointer (tree type, tree expr, bool force)
if (bk == bk_via_virtual)
{
if (force)
warning ("pointer to member cast from %qT to %qT is via"
warning (0, "pointer to member cast from %qT to %qT is via"
" virtual base", intype, type);
else
{
@ -512,7 +512,7 @@ convert_to_reference (tree reftype, tree expr, int convtype,
if (TREE_CODE (intype) == POINTER_TYPE
&& (comptypes (TREE_TYPE (intype), type,
COMPARE_BASE | COMPARE_DERIVED)))
warning ("casting %qT to %qT does not dereference pointer",
warning (0, "casting %qT to %qT does not dereference pointer",
intype, reftype);
rval = build_unary_op (ADDR_EXPR, expr, 0);
@ -854,10 +854,10 @@ convert_to_void (tree expr, const char *implicit)
int is_complete = COMPLETE_TYPE_P (complete_type (type));
if (is_volatile && !is_complete)
warning ("object of incomplete type %qT will not be accessed in %s",
warning (0, "object of incomplete type %qT will not be accessed in %s",
type, implicit ? implicit : "void context");
else if (is_reference && is_volatile)
warning ("object of type %qT will not be accessed in %s",
warning (0, "object of type %qT will not be accessed in %s",
TREE_TYPE (TREE_OPERAND (expr, 0)),
implicit ? implicit : "void context");
if (is_reference || !is_volatile || !is_complete)
@ -873,7 +873,7 @@ convert_to_void (tree expr, const char *implicit)
int is_complete = COMPLETE_TYPE_P (complete_type (type));
if (TYPE_VOLATILE (type) && !is_complete)
warning ("object %qE of incomplete type %qT will not be accessed in %s",
warning (0, "object %qE of incomplete type %qT will not be accessed in %s",
expr, type, implicit ? implicit : "void context");
break;
}
@ -895,7 +895,7 @@ convert_to_void (tree expr, const char *implicit)
}
else if (implicit && probe == expr && is_overloaded_fn (probe))
/* Only warn when there is no &. */
warning ("%s is a reference, not call, to function %qE",
warning (0, "%s is a reference, not call, to function %qE",
implicit, expr);
}
@ -906,7 +906,7 @@ convert_to_void (tree expr, const char *implicit)
/* The middle end does not warn about expressions that have
been explicitly cast to void, so we must do so here. */
if (!TREE_SIDE_EFFECTS (expr))
warning ("%s has no effect", implicit);
warning (0, "%s has no effect", implicit);
else
{
tree e;
@ -938,7 +938,7 @@ convert_to_void (tree expr, const char *implicit)
|| code == PREINCREMENT_EXPR
|| code == POSTDECREMENT_EXPR
|| code == POSTINCREMENT_EXPR)))
warning ("value computed is not used");
warning (0, "value computed is not used");
}
}
expr = build1 (CONVERT_EXPR, void_type_node, expr);
@ -1046,7 +1046,7 @@ build_expr_type_conversion (int desires, tree expr, bool complain)
if (expr == null_node
&& (desires & WANT_INT)
&& !(desires & WANT_NULL))
warning ("converting NULL to non-pointer type");
warning (0, "converting NULL to non-pointer type");
basetype = TREE_TYPE (expr);

View File

@ -565,7 +565,7 @@ poplevel (int keep, int reverse, int functionbody)
&& ! TREE_USED (decl)
&& ! DECL_IN_SYSTEM_HEADER (decl)
&& DECL_NAME (decl) && ! DECL_ARTIFICIAL (decl))
warning ("%Junused variable %qD", decl, decl);
warning (0, "%Junused variable %qD", decl, decl);
/* Remove declarations for all the DECLs in this level. */
for (link = decls; link; link = TREE_CHAIN (link))
@ -1055,17 +1055,17 @@ duplicate_decls (tree newdecl, tree olddecl)
&& DECL_UNINLINABLE (olddecl)
&& lookup_attribute ("noinline", DECL_ATTRIBUTES (olddecl)))
{
warning ("%Jfunction %qD redeclared as inline", newdecl, newdecl);
warning ("%Jprevious declaration of %qD with attribute noinline",
warning (0, "%Jfunction %qD redeclared as inline", newdecl, newdecl);
warning (0, "%Jprevious declaration of %qD with attribute noinline",
olddecl, olddecl);
}
else if (DECL_DECLARED_INLINE_P (olddecl)
&& DECL_UNINLINABLE (newdecl)
&& lookup_attribute ("noinline", DECL_ATTRIBUTES (newdecl)))
{
warning ("%Jfunction %qD redeclared with attribute noinline",
warning (0, "%Jfunction %qD redeclared with attribute noinline",
newdecl, newdecl);
warning ("%Jprevious declaration of %qD was inline",
warning (0, "%Jprevious declaration of %qD was inline",
olddecl, olddecl);
}
}
@ -1086,7 +1086,7 @@ duplicate_decls (tree newdecl, tree olddecl)
if (! TREE_PUBLIC (newdecl))
{
if (warn_shadow)
warning ("shadowing %s function %q#D",
warning (0, "shadowing %s function %q#D",
DECL_BUILT_IN (olddecl) ? "built-in" : "library",
olddecl);
/* Discard the old built-in function. */
@ -1095,7 +1095,7 @@ duplicate_decls (tree newdecl, tree olddecl)
/* If the built-in is not ansi, then programs can override
it even globally without an error. */
else if (! DECL_BUILT_IN (olddecl))
warning ("library function %q#D redeclared as non-function %q#D",
warning (0, "library function %q#D redeclared as non-function %q#D",
olddecl, newdecl);
else
{
@ -1152,12 +1152,12 @@ duplicate_decls (tree newdecl, tree olddecl)
if (TREE_PUBLIC (newdecl))
{
warning ("new declaration %q#D", newdecl);
warning ("ambiguates built-in declaration %q#D",
warning (0, "new declaration %q#D", newdecl);
warning (0, "ambiguates built-in declaration %q#D",
olddecl);
}
else if (warn_shadow)
warning ("shadowing %s function %q#D",
warning (0, "shadowing %s function %q#D",
DECL_BUILT_IN (olddecl) ? "built-in" : "library",
olddecl);
}
@ -1363,7 +1363,7 @@ duplicate_decls (tree newdecl, tree olddecl)
{
/* Prototype decl follows defn w/o prototype. */
cp_warning_at ("prototype for %q#D", newdecl);
warning ("%Jfollows non-prototype definition here", olddecl);
warning (0, "%Jfollows non-prototype definition here", olddecl);
}
else if (TREE_CODE (olddecl) == FUNCTION_DECL
&& DECL_LANGUAGE (newdecl) != DECL_LANGUAGE (olddecl))
@ -1418,8 +1418,8 @@ duplicate_decls (tree newdecl, tree olddecl)
&& ! DECL_DECLARED_INLINE_P (olddecl)
&& TREE_ADDRESSABLE (olddecl) && warn_inline)
{
warning ("%q#D was used before it was declared inline", newdecl);
warning ("%Jprevious non-inline declaration here", olddecl);
warning (0, "%q#D was used before it was declared inline", newdecl);
warning (0, "%Jprevious non-inline declaration here", olddecl);
}
}
}
@ -1471,7 +1471,7 @@ duplicate_decls (tree newdecl, tree olddecl)
/* Don't warn about friends, let add_friend take care of it. */
&& ! (DECL_FRIEND_P (newdecl) || DECL_FRIEND_P (olddecl)))
{
warning ("redundant redeclaration of %qD in same scope", newdecl);
warning (0, "redundant redeclaration of %qD in same scope", newdecl);
cp_warning_at ("previous declaration of %qD", olddecl);
}
}
@ -1806,9 +1806,9 @@ duplicate_decls (tree newdecl, tree olddecl)
&& DECL_VISIBILITY_SPECIFIED (newdecl)
&& DECL_VISIBILITY (newdecl) != DECL_VISIBILITY (olddecl))
{
warning ("%J%qD: visibility attribute ignored because it",
warning (0, "%J%qD: visibility attribute ignored because it",
newdecl, newdecl);
warning ("%Jconflicts with previous declaration here", olddecl);
warning (0, "%Jconflicts with previous declaration here", olddecl);
}
/* Choose the declaration which specified visibility. */
if (DECL_VISIBILITY_SPECIFIED (olddecl))
@ -3645,7 +3645,7 @@ start_decl (const cp_declarator *declarator,
{
if (! toplevel_bindings_p ()
&& DECL_EXTERNAL (decl))
warning ("declaration of %q#D has %<extern%> and is initialized",
warning (0, "declaration of %q#D has %<extern%> and is initialized",
decl);
DECL_EXTERNAL (decl) = 0;
if (toplevel_bindings_p ())
@ -3667,7 +3667,7 @@ start_decl (const cp_declarator *declarator,
&& DECL_DECLARED_INLINE_P (decl)
&& DECL_UNINLINABLE (decl)
&& lookup_attribute ("noinline", DECL_ATTRIBUTES (decl)))
warning ("%Jinline function %qD given attribute noinline", decl, decl);
warning (0, "%Jinline function %qD given attribute noinline", decl, decl);
if (context && COMPLETE_TYPE_P (complete_type (context)))
{
@ -4052,7 +4052,7 @@ maybe_commonize_var (tree decl)
cp_warning_at ("sorry: semantics of inline function static "
"data %q#D are wrong (you'll wind up "
"with multiple copies)", decl);
warning ("%J you can work around this by removing "
warning (0, "%J you can work around this by removing "
"the initializer",
decl);
}
@ -4366,7 +4366,7 @@ reshape_init (tree type, tree *initp)
if (brace_enclosed_p)
error ("too many initializers for %qT", type);
else if (warn_missing_braces && !string_init_p)
warning ("missing braces around initializer");
warning (0, "missing braces around initializer");
}
return new_init;
@ -4506,7 +4506,7 @@ check_initializer (tree decl, tree init, int flags, tree *cleanup)
&& DECL_INITIAL (decl)
&& TREE_CODE (DECL_INITIAL (decl)) == STRING_CST
&& PAREN_STRING_LITERAL_P (DECL_INITIAL (decl)))
warning ("array %qD initialized by parenthesized string literal %qE",
warning (0, "array %qD initialized by parenthesized string literal %qE",
decl, DECL_INITIAL (decl));
init = NULL;
}
@ -4783,7 +4783,7 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags)
&& IS_AGGR_TYPE (type) && DECL_NAME (decl))
{
if (TREE_TYPE (DECL_NAME (decl)) && TREE_TYPE (decl) != type)
warning ("shadowing previous type declaration of %q#D", decl);
warning (0, "shadowing previous type declaration of %q#D", decl);
set_identifier_type_value (DECL_NAME (decl), decl);
}
@ -5885,7 +5885,7 @@ grokvardecl (tree type,
no linkage can only be used to declare extern "C"
entities. Since it's not always an error in the
ISO C++ 90 Standard, we only issue a warning. */
warning ("non-local variable %q#D uses anonymous type",
warning (0, "non-local variable %q#D uses anonymous type",
decl);
if (DECL_ORIGINAL_TYPE (TYPE_NAME (t)))
cp_warning_at ("%q#D does not refer to the unqualified "
@ -5894,7 +5894,7 @@ grokvardecl (tree type,
}
}
else
warning ("non-local variable %q#D uses local type %qT", decl, t);
warning (0, "non-local variable %q#D uses local type %qT", decl, t);
}
}
else
@ -6728,7 +6728,7 @@ grokdeclarator (const cp_declarator *declarator,
else if (pedantic || ! is_main)
pedwarn ("ISO C++ forbids declaration of %qs with no type", name);
else if (warn_return_type)
warning ("ISO C++ forbids declaration of %qs with no type", name);
warning (0, "ISO C++ forbids declaration of %qs with no type", name);
type = integer_type_node;
}
@ -7013,7 +7013,7 @@ grokdeclarator (const cp_declarator *declarator,
/* It's common practice (and completely valid) to have a const
be initialized and declared extern. */
if (!(type_quals & TYPE_QUAL_CONST))
warning ("%qs initialized and declared %<extern%>", name);
warning (0, "%qs initialized and declared %<extern%>", name);
}
else
error ("%qs has both %<extern%> and initializer", name);
@ -7953,7 +7953,7 @@ grokdeclarator (const cp_declarator *declarator,
{
/* Friends are treated specially. */
if (ctype == current_class_type)
warning ("member functions are implicitly friends of their class");
warning (0, "member functions are implicitly friends of their class");
else if (decl && DECL_NAME (decl))
{
if (template_class_depth (current_class_type) == 0)
@ -8777,7 +8777,7 @@ grok_op_properties (tree decl, int friendp, bool complain)
what = "a base class";
if (what && warn_conversion)
warning ("conversion to %s%s will never use a type "
warning (0, "conversion to %s%s will never use a type "
"conversion operator",
ref ? "a reference to " : "", what);
}
@ -8869,13 +8869,13 @@ grok_op_properties (tree decl, int friendp, bool complain)
if (TREE_CODE (ret) != REFERENCE_TYPE
|| !same_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (ret)),
arg))
warning ("prefix %qD should return %qT", decl,
warning (0, "prefix %qD should return %qT", decl,
build_reference_type (arg));
}
else
{
if (!same_type_p (TYPE_MAIN_VARIANT (ret), arg))
warning ("postfix %qD should return %qT", decl, arg);
warning (0, "postfix %qD should return %qT", decl, arg);
}
}
}
@ -8904,7 +8904,7 @@ grok_op_properties (tree decl, int friendp, bool complain)
&& (operator_code == TRUTH_ANDIF_EXPR
|| operator_code == TRUTH_ORIF_EXPR
|| operator_code == COMPOUND_EXPR))
warning ("user-defined %qD always evaluates both arguments",
warning (0, "user-defined %qD always evaluates both arguments",
decl);
}
@ -8918,7 +8918,7 @@ grok_op_properties (tree decl, int friendp, bool complain)
|| operator_code == MULT_EXPR
|| operator_code == TRUNC_MOD_EXPR)
&& TREE_CODE (TREE_TYPE (TREE_TYPE (decl))) == REFERENCE_TYPE)
warning ("%qD should return by value", decl);
warning (0, "%qD should return by value", decl);
/* [over.oper]/8 */
for (; argtypes && argtypes != void_list_node;
@ -9906,7 +9906,7 @@ start_preparsed_function (tree decl1, tree attrs, int flags)
if (DECL_DECLARED_INLINE_P (decl1)
&& lookup_attribute ("noinline", attrs))
warning ("%Jinline function %qD given attribute noinline", decl1, decl1);
warning (0, "%Jinline function %qD given attribute noinline", decl1, decl1);
if (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (decl1))
/* This is a constructor, we must ensure that any default args
@ -9943,7 +9943,7 @@ start_preparsed_function (tree decl1, tree attrs, int flags)
if (warn_ecpp
&& DECL_OVERLOADED_OPERATOR_P (decl1) == NOP_EXPR
&& TREE_CODE (TREE_TYPE (fntype)) == VOID_TYPE)
warning ("%<operator=%> should return a reference to %<*this%>");
warning (0, "%<operator=%> should return a reference to %<*this%>");
/* Make the init_value nonzero so pushdecl knows this is not tentative.
error_mark_node is replaced below (in poplevel) with the BLOCK. */
@ -10676,7 +10676,7 @@ finish_function (int flags)
/* Structor return values (if any) are set by the compiler. */
&& !DECL_CONSTRUCTOR_P (fndecl)
&& !DECL_DESTRUCTOR_P (fndecl))
warning ("no return statement in function returning non-void");
warning (0, "no return statement in function returning non-void");
/* Store the end of the function, so that we get good line number
info for the epilogue. */

View File

@ -420,7 +420,7 @@ delete_sanity (tree exp, tree size, bool doing_vec, int use_global_delete)
/* An array can't have been allocated by new, so complain. */
if (TREE_CODE (exp) == VAR_DECL
&& TREE_CODE (TREE_TYPE (exp)) == ARRAY_TYPE)
warning ("deleting array %q#D", exp);
warning (0, "deleting array %q#D", exp);
t = build_expr_type_conversion (WANT_POINTER, exp, true);
@ -446,7 +446,7 @@ delete_sanity (tree exp, tree size, bool doing_vec, int use_global_delete)
/* Deleting ptr to void is undefined behavior [expr.delete/3]. */
if (TREE_CODE (TREE_TYPE (type)) == VOID_TYPE)
{
warning ("deleting %qT is undefined", type);
warning (0, "deleting %qT is undefined", type);
doing_vec = 0;
}
@ -1168,7 +1168,7 @@ finish_anon_union (tree anon_union_decl)
main_decl = build_anon_union_vars (type, anon_union_decl);
if (main_decl == NULL_TREE)
{
warning ("anonymous union with no members");
warning (0, "anonymous union with no members");
return;
}

View File

@ -599,7 +599,7 @@ build_throw (tree exp)
}
if (exp == null_node)
warning ("throwing NULL, which has integral, not pointer type");
warning (0, "throwing NULL, which has integral, not pointer type");
if (exp != NULL_TREE)
{
@ -918,9 +918,9 @@ check_handlers_1 (tree master, tree_stmt_iterator i)
tree handler = tsi_stmt (i);
if (TREE_TYPE (handler) && can_convert_eh (type, TREE_TYPE (handler)))
{
warning ("%Hexception of type %qT will be caught",
warning (0, "%Hexception of type %qT will be caught",
EXPR_LOCUS (handler), TREE_TYPE (handler));
warning ("%H by earlier handler for %qT",
warning (0, "%H by earlier handler for %qT",
EXPR_LOCUS (master), type);
break;
}

View File

@ -149,7 +149,7 @@ add_friend (tree type, tree decl, bool complain)
if (decl == TREE_VALUE (friends))
{
if (complain)
warning ("%qD is already a friend of class %qT",
warning (0, "%qD is already a friend of class %qT",
decl, type);
return;
}
@ -361,7 +361,7 @@ make_friend_class (tree type, tree friend_type, bool complain)
if (friend_type == probe)
{
if (complain)
warning ("%qD is already a friend of %qT", probe, type);
warning (0, "%qD is already a friend of %qT", probe, type);
break;
}
}
@ -370,7 +370,7 @@ make_friend_class (tree type, tree friend_type, bool complain)
if (same_type_p (probe, friend_type))
{
if (complain)
warning ("%qT is already a friend of %qT", probe, type);
warning (0, "%qT is already a friend of %qT", probe, type);
break;
}
}
@ -550,11 +550,11 @@ do_friend (tree ctype, tree declarator, tree decl,
if (warn)
{
static int explained;
warning ("friend declaration %q#D declares a non-template "
warning (0, "friend declaration %q#D declares a non-template "
"function", decl);
if (! explained)
{
warning ("(if this is not what you intended, make sure "
warning (0, "(if this is not what you intended, make sure "
"the function template has already been declared "
"and add <> after the function name here) "
"-Wno-non-template-friend disables this warning");

View File

@ -323,7 +323,7 @@ perform_member_init (tree member, tree init)
/* Effective C++ rule 12 requires that all data members be
initialized. */
if (warn_ecpp && !explicit && TREE_CODE (type) != ARRAY_TYPE)
warning ("%J%qD should be initialized in the member initialization "
warning (0, "%J%qD should be initialized in the member initialization "
"list", current_function_decl, member);
if (init == void_type_node)
@ -370,7 +370,7 @@ perform_member_init (tree member, tree init)
{
init = build_default_init (type, /*nelts=*/NULL_TREE);
if (TREE_CODE (type) == REFERENCE_TYPE)
warning ("%Jdefault-initialization of %q#D, "
warning (0, "%Jdefault-initialization of %q#D, "
"which has reference type",
current_function_decl, member);
}
@ -525,13 +525,13 @@ sort_mem_initializers (tree t, tree mem_inits)
cp_warning_at ("%qD will be initialized after",
TREE_PURPOSE (next_subobject));
else
warning ("base %qT will be initialized after",
warning (0, "base %qT will be initialized after",
TREE_PURPOSE (next_subobject));
if (TREE_CODE (subobject) == FIELD_DECL)
cp_warning_at (" %q#D", subobject);
else
warning (" base %qT", subobject);
warning ("%J when initialized here", current_function_decl);
warning (0, " base %qT", subobject);
warning (0, "%J when initialized here", current_function_decl);
}
/* Look again, from the beginning of the list. */
@ -679,7 +679,7 @@ emit_mem_initializers (tree mem_inits)
if (extra_warnings && !arguments
&& DECL_COPY_CONSTRUCTOR_P (current_function_decl)
&& TYPE_NEEDS_CONSTRUCTING (BINFO_TYPE (subobject)))
warning ("%Jbase class %q#T should be explicitly initialized in the "
warning (0, "%Jbase class %q#T should be explicitly initialized in the "
"copy constructor",
current_function_decl, BINFO_TYPE (subobject));
@ -1645,7 +1645,7 @@ build_new (tree placement, tree type, tree nelts, tree init,
pedwarn ("size in array new must have integral type");
nelts = save_expr (cp_convert (sizetype, nelts));
if (nelts == integer_zero_node)
warning ("zero size array reserves no space");
warning (0, "zero size array reserves no space");
}
/* ``A reference cannot be created by the new operator. A reference
@ -2735,7 +2735,7 @@ build_delete (tree type, tree addr, special_function_kind auto_delete,
complete_type (type);
if (!COMPLETE_TYPE_P (type))
{
warning ("possible problem detected in invocation of "
warning (0, "possible problem detected in invocation of "
"delete operator:");
cxx_incomplete_type_diagnostic (addr, type, 1);
inform ("neither the destructor nor the class-specific "

View File

@ -433,7 +433,7 @@ parse_strconst_pragma (const char* name, int opt)
{
result = x;
if (c_lex (&x) != CPP_EOF)
warning ("junk at end of #pragma %s", name);
warning (0, "junk at end of #pragma %s", name);
return result;
}
@ -527,7 +527,7 @@ handle_pragma_implementation (cpp_reader* dfile ATTRIBUTE_UNUSED )
cookie (if any) of the filename, but this requires completing the
--enable-mapped-location project first. See PR 17577. */
if (cpp_included (parse_in, filename))
warning ("#pragma implementation for %qs appears after "
warning (0, "#pragma implementation for %qs appears after "
"file is included", filename);
#endif
}
@ -552,7 +552,7 @@ handle_pragma_java_exceptions (cpp_reader* dfile ATTRIBUTE_UNUSED )
{
tree x;
if (c_lex (&x) != CPP_EOF)
warning ("junk at end of #pragma GCC java_exceptions");
warning (0, "junk at end of #pragma GCC java_exceptions");
choose_personality_routine (lang_java);
}

View File

@ -2479,7 +2479,7 @@ static inline const char *
finish_mangling (const bool warn)
{
if (warn_abi && warn && G.need_abi_warning)
warning ("the mangled name of %qD will change in a future "
warning (0, "the mangled name of %qD will change in a future "
"version of GCC",
G.entity);

View File

@ -1096,7 +1096,7 @@ lazily_declare_fn (special_function_kind sfk, tree type)
TYPE_METHODS list, which cause the destructor to be emitted
in an incorrect location in the vtable. */
if (warn_abi && DECL_VIRTUAL_P (fn))
warning ("vtable layout for class %qT may not be ABI-compliant"
warning (0, "vtable layout for class %qT may not be ABI-compliant"
"and may change in a future version of GCC due to "
"implicit virtual destructor",
type);

View File

@ -894,7 +894,7 @@ pushdecl (tree x)
/* OK */;
else
{
warning ("extern declaration of %q#D doesn't match", x);
warning (0, "extern declaration of %q#D doesn't match", x);
cp_warning_at ("global declaration %q#D", oldglobal);
}
}
@ -938,8 +938,8 @@ pushdecl (tree x)
if (warn_shadow && !err)
{
warning ("declaration of %q#D shadows a parameter", x);
warning ("%Jshadowed declaration is here", oldlocal);
warning (0, "declaration of %q#D shadows a parameter", x);
warning (0, "%Jshadowed declaration is here", oldlocal);
}
}
@ -963,22 +963,22 @@ pushdecl (tree x)
if (member && !TREE_STATIC (member))
{
/* Location of previous decl is not useful in this case. */
warning ("declaration of %qD shadows a member of 'this'",
warning (0, "declaration of %qD shadows a member of 'this'",
x);
}
else if (oldlocal != NULL_TREE
&& TREE_CODE (oldlocal) == VAR_DECL)
{
warning ("declaration of %qD shadows a previous local", x);
warning ("%Jshadowed declaration is here", oldlocal);
warning (0, "declaration of %qD shadows a previous local", x);
warning (0, "%Jshadowed declaration is here", oldlocal);
}
else if (oldglobal != NULL_TREE
&& TREE_CODE (oldglobal) == VAR_DECL)
/* XXX shadow warnings in outer-more namespaces */
{
warning ("declaration of %qD shadows a global declaration",
warning (0, "declaration of %qD shadows a global declaration",
x);
warning ("%Jshadowed declaration is here", oldglobal);
warning (0, "%Jshadowed declaration is here", oldglobal);
}
}
}
@ -1092,7 +1092,7 @@ check_for_out_of_scope_variable (tree decl)
{
if (!DECL_ERROR_REPORTED (decl))
{
warning ("name lookup of %qD changed", DECL_NAME (decl));
warning (0, "name lookup of %qD changed", DECL_NAME (decl));
cp_warning_at (" matches this %qD under ISO standard rules",
shadowed);
cp_warning_at (" matches this %qD under old rules", decl);
@ -1861,7 +1861,7 @@ push_overloaded_decl (tree decl, int flags)
if (IS_AGGR_TYPE (t) && warn_shadow
&& (! DECL_IN_SYSTEM_HEADER (decl)
|| ! DECL_IN_SYSTEM_HEADER (old)))
warning ("%q#D hides constructor for %q#T", decl, t);
warning (0, "%q#D hides constructor for %q#T", decl, t);
old = NULL_TREE;
}
else if (is_overloaded_fn (old))
@ -3207,7 +3207,7 @@ parse_using_directive (tree namespace, tree attribs)
DECL_NAMESPACE_ASSOCIATIONS (namespace));
}
else
warning ("%qD attribute directive ignored", name);
warning (0, "%qD attribute directive ignored", name);
}
}

View File

@ -1798,7 +1798,7 @@ static inline void
cp_parser_warn_min_max (void)
{
if (warn_deprecated && !in_system_header)
warning ("minimum/maximum operators are deprecated");
warning (0, "minimum/maximum operators are deprecated");
}
/* If not parsing tentatively, issue a diagnostic of the form
@ -5297,7 +5297,7 @@ cp_parser_cast_expression (cp_parser *parser, bool address_p, bool cast_p)
&& !in_system_header
&& !VOID_TYPE_P (type)
&& current_lang_name != lang_name_c)
warning ("use of old-style cast");
warning (0, "use of old-style cast");
/* Only type conversions to integral or enumeration types
can be used in constant-expressions. */
@ -8128,7 +8128,7 @@ cp_parser_template_declaration (cp_parser* parser, bool member_p)
/* Consume the `export' token. */
cp_lexer_consume_token (parser->lexer);
/* Warn that we do not support `export'. */
warning ("keyword %<export%> not implemented, and will be ignored");
warning (0, "keyword %<export%> not implemented, and will be ignored");
}
cp_parser_template_declaration_after_export (parser, member_p);
@ -9914,7 +9914,7 @@ cp_parser_elaborated_type_specifier (cp_parser* parser,
/* Warn about attributes. They are ignored. */
if (attributes)
warning ("type attributes are honored only at type definition");
warning (0, "type attributes are honored only at type definition");
type = xref_tag (tag_type, identifier, ts,
parser->num_template_parameter_lists);
@ -10759,7 +10759,7 @@ cp_parser_init_declarator (cp_parser* parser,
attributes -- but ignores them. */
if (cp_parser_allow_gnu_extensions_p (parser) && is_parenthesized_init)
if (cp_parser_attributes_opt (parser))
warning ("attributes after parenthesized initializer ignored");
warning (0, "attributes after parenthesized initializer ignored");
/* For an in-class declaration, use `grokfield' to create the
declaration. */
@ -12036,7 +12036,7 @@ cp_parser_parameter_declaration (cp_parser *parser,
if (!parser->default_arg_ok_p)
{
if (!flag_pedantic_errors)
warning ("deprecated use of default argument for parameter of non-function");
warning (0, "deprecated use of default argument for parameter of non-function");
else
{
error ("default arguments are only permitted for function parameters");

View File

@ -109,7 +109,7 @@ get_base_filename (const char *filename)
if (p && ! compiling)
{
warning ("-frepo must be used with -c");
warning (0, "-frepo must be used with -c");
flag_use_repository = 0;
return NULL;
}

View File

@ -567,7 +567,7 @@ build_dynamic_cast_1 (tree type, tree expr)
&& TREE_CODE (TREE_TYPE (old_expr)) == RECORD_TYPE)
{
tree expr = throw_bad_cast ();
warning ("dynamic_cast of %q#D to %q#T can never succeed",
warning (0, "dynamic_cast of %q#D to %q#T can never succeed",
old_expr, type);
/* Bash it to the expected type. */
TREE_TYPE (expr) = type;
@ -581,7 +581,7 @@ build_dynamic_cast_1 (tree type, tree expr)
if (TREE_CODE (op) == VAR_DECL
&& TREE_CODE (TREE_TYPE (op)) == RECORD_TYPE)
{
warning ("dynamic_cast of %q#D to %q#T can never succeed",
warning (0, "dynamic_cast of %q#D to %q#T can never succeed",
op, type);
retval = build_int_cst (type, 0);
return retval;

View File

@ -1767,12 +1767,12 @@ handle_com_interface_attribute (tree* node,
|| !CLASS_TYPE_P (*node)
|| *node != TYPE_MAIN_VARIANT (*node))
{
warning ("%qE attribute can only be applied to class definitions", name);
warning (0, "%qE attribute can only be applied to class definitions", name);
return NULL_TREE;
}
if (!warned++)
warning ("%qE is obsolete; g++ vtables are now COM-compatible by default",
warning (0, "%qE is obsolete; g++ vtables are now COM-compatible by default",
name);
return NULL_TREE;
@ -1835,7 +1835,7 @@ handle_init_priority_attribute (tree* node,
if (pri <= MAX_RESERVED_INIT_PRIORITY)
{
warning
("requested init_priority is reserved for internal use");
(0, "requested init_priority is reserved for internal use");
}
if (SUPPORTS_INIT_PRIORITY)

View File

@ -1480,7 +1480,7 @@ string_conv_p (tree totype, tree exp, int warn)
/* This warning is not very useful, as it complains about printf. */
if (warn && warn_write_strings)
warning ("deprecated conversion from string constant to %qT'", totype);
warning (0, "deprecated conversion from string constant to %qT'", totype);
return 1;
}
@ -1698,9 +1698,9 @@ build_class_member_access_expr (tree object, tree member,
&& !DECL_FIELD_IS_BASE (member)
&& !skip_evaluation)
{
warning ("invalid access to non-static data member %qD of NULL object",
warning (0, "invalid access to non-static data member %qD of NULL object",
member);
warning ("(perhaps the %<offsetof%> macro was used incorrectly)");
warning (0, "(perhaps the %<offsetof%> macro was used incorrectly)");
}
/* If MEMBER is from an anonymous aggregate, we have converted
@ -2174,7 +2174,7 @@ build_array_ref (tree array, tree idx)
must have done so deliberately. */
if (warn_char_subscripts
&& TYPE_MAIN_VARIANT (TREE_TYPE (idx)) == char_type_node)
warning ("array subscript has type %<char%>");
warning (0, "array subscript has type %<char%>");
if (!INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (idx)))
{
@ -2226,7 +2226,7 @@ build_array_ref (tree array, tree idx)
while (TREE_CODE (foo) == COMPONENT_REF)
foo = TREE_OPERAND (foo, 0);
if (TREE_CODE (foo) == VAR_DECL && DECL_REGISTER (foo))
warning ("subscripting array declared %<register%>");
warning (0, "subscripting array declared %<register%>");
}
type = TREE_TYPE (TREE_TYPE (array));
@ -2854,9 +2854,9 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
|| code1 == COMPLEX_TYPE || code1 == VECTOR_TYPE))
{
if (TREE_CODE (op1) == INTEGER_CST && integer_zerop (op1))
warning ("division by zero in %<%E / 0%>", op0);
warning (0, "division by zero in %<%E / 0%>", op0);
else if (TREE_CODE (op1) == REAL_CST && real_zerop (op1))
warning ("division by zero in %<%E / 0.%>", op0);
warning (0, "division by zero in %<%E / 0.%>", op0);
if (code0 == COMPLEX_TYPE || code0 == VECTOR_TYPE)
code0 = TREE_CODE (TREE_TYPE (TREE_TYPE (op0)));
@ -2890,9 +2890,9 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
case TRUNC_MOD_EXPR:
case FLOOR_MOD_EXPR:
if (code1 == INTEGER_TYPE && integer_zerop (op1))
warning ("division by zero in %<%E %% 0%>", op0);
warning (0, "division by zero in %<%E %% 0%>", op0);
else if (code1 == REAL_TYPE && real_zerop (op1))
warning ("division by zero in %<%E %% 0.%>", op0);
warning (0, "division by zero in %<%E %% 0.%>", op0);
if (code0 == INTEGER_TYPE && code1 == INTEGER_TYPE)
{
@ -2926,13 +2926,13 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
if (TREE_CODE (op1) == INTEGER_CST)
{
if (tree_int_cst_lt (op1, integer_zero_node))
warning ("right shift count is negative");
warning (0, "right shift count is negative");
else
{
if (! integer_zerop (op1))
short_shift = 1;
if (compare_tree_int (op1, TYPE_PRECISION (type0)) >= 0)
warning ("right shift count >= width of type");
warning (0, "right shift count >= width of type");
}
}
/* Convert the shift-count to an integer, regardless of
@ -2951,9 +2951,9 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
if (TREE_CODE (op1) == INTEGER_CST)
{
if (tree_int_cst_lt (op1, integer_zero_node))
warning ("left shift count is negative");
warning (0, "left shift count is negative");
else if (compare_tree_int (op1, TYPE_PRECISION (type0)) >= 0)
warning ("left shift count >= width of type");
warning (0, "left shift count >= width of type");
}
/* Convert the shift-count to an integer, regardless of
size of value being shifted. */
@ -2972,10 +2972,10 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
if (TREE_CODE (op1) == INTEGER_CST)
{
if (tree_int_cst_lt (op1, integer_zero_node))
warning ("%s rotate count is negative",
warning (0, "%s rotate count is negative",
(code == LROTATE_EXPR) ? "left" : "right");
else if (compare_tree_int (op1, TYPE_PRECISION (type0)) >= 0)
warning ("%s rotate count >= width of type",
warning (0, "%s rotate count >= width of type",
(code == LROTATE_EXPR) ? "left" : "right");
}
/* Convert the shift-count to an integer, regardless of
@ -2988,7 +2988,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
case EQ_EXPR:
case NE_EXPR:
if (warn_float_equal && (code0 == REAL_TYPE || code1 == REAL_TYPE))
warning ("comparing floating point with == or != is unsafe");
warning (0, "comparing floating point with == or != is unsafe");
build_type = boolean_type_node;
if ((code0 == INTEGER_TYPE || code0 == REAL_TYPE
@ -3315,7 +3315,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 ("comparison between types %q#T and %q#T",
warning (0, "comparison between types %q#T and %q#T",
TREE_TYPE (orig_op0), TREE_TYPE (orig_op1));
}
@ -3351,7 +3351,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
(result_type)))))
/* OK */;
else
warning ("comparison between signed and unsigned integer expressions");
warning (0, "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
@ -3395,7 +3395,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 ("comparison of promoted ~unsigned with constant");
warning (0, "comparison of promoted ~unsigned with constant");
}
}
else if (unsignedp0 && unsignedp1
@ -3403,7 +3403,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 ("comparison of promoted ~unsigned with unsigned");
warning (0, "comparison of promoted ~unsigned with unsigned");
}
}
}
@ -3430,7 +3430,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
performed. Note that pointer-difference and pointer-addition
have already been handled above, and so we don't end up here in
that case. */
warning ("NULL used in arithmetic");
warning (0, "NULL used in arithmetic");
if (! converted)
{
@ -3593,7 +3593,7 @@ build_x_unary_op (enum tree_code code, tree xarg)
}
}
else if (TREE_CODE (xarg) == TARGET_EXPR)
warning ("taking address of temporary");
warning (0, "taking address of temporary");
exp = build_unary_op (ADDR_EXPR, xarg, 0);
}
@ -4288,7 +4288,7 @@ cxx_mark_addressable (tree exp)
}
else if (extra_warnings)
warning
("address requested for %qD, which is declared %<register%>", x);
(0, "address requested for %qD, which is declared %<register%>", x);
}
TREE_ADDRESSABLE (x) = 1;
return true;
@ -4492,7 +4492,7 @@ build_static_cast_1 (tree type, tree expr, bool c_cast_p,
{
/* C-style casts are allowed to cast away constness. With
WARN_CAST_QUAL, we still want to issue a warning. */
diag_fn = warn_cast_qual ? warning : NULL;
diag_fn = warn_cast_qual ? warning0 : NULL;
desc = "cast";
}
else
@ -4807,7 +4807,7 @@ build_reinterpret_cast_1 (tree type, tree expr, bool c_cast_p,
if (TYPE_PTR_P (intype)
&& (comptypes (TREE_TYPE (intype), TREE_TYPE (type),
COMPARE_BASE | COMPARE_DERIVED)))
warning ("casting %qT to %qT does not dereference pointer",
warning (0, "casting %qT to %qT does not dereference pointer",
intype, type);
expr = build_unary_op (ADDR_EXPR, expr, 0);
@ -4879,7 +4879,7 @@ build_reinterpret_cast_1 (tree type, tree expr, bool c_cast_p,
&& COMPLETE_TYPE_P (TREE_TYPE (type))
&& COMPLETE_TYPE_P (TREE_TYPE (intype))
&& TYPE_ALIGN (TREE_TYPE (type)) > TYPE_ALIGN (TREE_TYPE (intype)))
warning ("cast from %qT to %qT increases required alignment of "
warning (0, "cast from %qT to %qT increases required alignment of "
"target type",
intype, type);
@ -4893,7 +4893,7 @@ build_reinterpret_cast_1 (tree type, tree expr, bool c_cast_p,
where possible, and it is necessary in some cases. DR 195
addresses this issue, but as of 2004/10/26 is still in
drafting. */
warning ("ISO C++ forbids casting between pointer-to-function and pointer-to-object");
warning (0, "ISO C++ forbids casting between pointer-to-function and pointer-to-object");
return fold_if_not_in_template (build_nop (type, expr));
}
else if (TREE_CODE (type) == VECTOR_TYPE)
@ -5535,7 +5535,7 @@ get_delta_difference (tree from, tree to,
virt_binfo = binfo_from_vbase (binfo);
if (virt_binfo)
/* This is a reinterpret cast, we choose to do nothing. */
warning ("pointer to member cast via virtual base %qT",
warning (0, "pointer to member cast via virtual base %qT",
BINFO_TYPE (virt_binfo));
else
result = size_diffop (size_zero_node, BINFO_OFFSET (binfo));
@ -5551,7 +5551,7 @@ get_delta_difference (tree from, tree to,
{
/* This is a reinterpret cast, we choose to do nothing. */
if (allow_inverse_p)
warning ("pointer to member cast via virtual base %qT",
warning (0, "pointer to member cast via virtual base %qT",
BINFO_TYPE (virt_binfo));
else
error ("pointer to member conversion via virtual base %qT",
@ -5973,14 +5973,14 @@ maybe_warn_about_returning_address_of_local (tree retval)
if (TREE_CODE (whats_returned) == AGGR_INIT_EXPR
|| TREE_CODE (whats_returned) == TARGET_EXPR)
{
warning ("returning reference to temporary");
warning (0, "returning reference to temporary");
return;
}
if (TREE_CODE (whats_returned) == VAR_DECL
&& DECL_NAME (whats_returned)
&& TEMP_NAME_P (DECL_NAME (whats_returned)))
{
warning ("reference to non-lvalue returned");
warning (0, "reference to non-lvalue returned");
return;
}
}
@ -6019,7 +6019,7 @@ check_return_expr (tree retval)
(This is a G++ extension, used to get better code for functions
that call the `volatile' function.) */
if (TREE_THIS_VOLATILE (current_function_decl))
warning ("function declared %<noreturn%> has a %<return%> statement");
warning (0, "function declared %<noreturn%> has a %<return%> statement");
/* Check for various simple errors. */
if (DECL_DESTRUCTOR_P (current_function_decl))
@ -6107,7 +6107,7 @@ check_return_expr (tree retval)
&& !TYPE_NOTHROW_P (TREE_TYPE (current_function_decl))
&& ! flag_check_new
&& null_ptr_cst_p (retval))
warning ("%<operator new%> must not return NULL unless it is "
warning (0, "%<operator new%> must not return NULL unless it is "
"declared %<throw()%> (or -fcheck-new is in effect)");
/* Effective C++ rule 15. See also start_function. */
@ -6133,7 +6133,7 @@ check_return_expr (tree retval)
}
if (warn)
warning ("%<operator=%> should return a reference to %<*this%>");
warning (0, "%<operator=%> should return a reference to %<*this%>");
}
/* The fabled Named Return Value optimization, as per [class.copy]/15:

View File

@ -352,7 +352,7 @@ cxx_incomplete_type_diagnostic (tree value, tree type, int diag_type)
if (diag_type == 1)
{
p_msg = warning;
p_msg = warning0;
p_msg_at = cp_warning_at;
}
else if (diag_type == 2)
@ -839,7 +839,7 @@ process_init_constructor (tree type, tree init, tree* elts)
if (elts)
{
if (warn_missing_braces)
warning ("aggregate has a partly bracketed initializer");
warning (0, "aggregate has a partly bracketed initializer");
tail = *elts;
}
else
@ -1005,7 +1005,7 @@ process_init_constructor (tree type, tree init, tree* elts)
/* Warn when some struct elements are implicitly initialized. */
if (warn_missing_field_initializers
&& (!init || BRACE_ENCLOSED_INITIALIZER_P (init)))
warning ("missing initializer for member %qD", field);
warning (0, "missing initializer for member %qD", field);
}
else
{
@ -1020,7 +1020,7 @@ process_init_constructor (tree type, tree init, tree* elts)
to zero. */
if (warn_missing_field_initializers
&& (!init || BRACE_ENCLOSED_INITIALIZER_P (init)))
warning ("missing initializer for member %qD", field);
warning (0, "missing initializer for member %qD", field);
if (! zero_init_p (TREE_TYPE (field)))
next1 = build_zero_init (TREE_TYPE (field),

View File

@ -412,7 +412,19 @@ inform (const char *msgid, ...)
/* A warning. Use this for code which is correct according to the
relevant language specification but is likely to be buggy anyway. */
void
warning (const char *msgid, ...)
warning (int opt ATTRIBUTE_UNUSED, const char *msgid, ...)
{
diagnostic_info diagnostic;
va_list ap;
va_start (ap, msgid);
diagnostic_set_info (&diagnostic, msgid, &ap, input_location, DK_WARNING);
report_diagnostic (&diagnostic);
va_end (ap);
}
void
warning0 (const char *msgid, ...)
{
diagnostic_info diagnostic;
va_list ap;

View File

@ -3266,7 +3266,7 @@ make_insn_raw (rtx pattern)
|| (GET_CODE (insn) == SET
&& SET_DEST (insn) == pc_rtx)))
{
warning ("ICE: emit_insn used where emit_jump_insn needed:\n");
warning (0, "ICE: emit_insn used where emit_jump_insn needed:\n");
debug_rtx (insn);
}
#endif

View File

@ -42,7 +42,7 @@ int have_error = 0;
/* Print a warning message - output produced, but there may be problems. */
void
warning (const char *format, ...)
warning (int opt ATTRIBUTE_UNUSED, const char *format, ...)
{
va_list ap;

View File

@ -30,7 +30,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#ifndef GCC_ERRORS_H
#define GCC_ERRORS_H
extern void warning (const char *, ...);
extern void warning (int, const char *, ...);
extern void error (const char *, ...);
extern void fatal (const char *, ...) ATTRIBUTE_NORETURN;
extern void internal_error (const char *, ...) ATTRIBUTE_NORETURN;

View File

@ -3226,7 +3226,7 @@ optimize_bit_field_compare (enum tree_code code, tree compare_type,
fold_convert (unsigned_type, rhs),
size_int (lbitsize), 0)))
{
warning ("comparison is always %d due to width of bit-field",
warning (0, "comparison is always %d due to width of bit-field",
code == NE_EXPR);
return constant_boolean_node (code == NE_EXPR, compare_type);
}
@ -3237,7 +3237,7 @@ optimize_bit_field_compare (enum tree_code code, tree compare_type,
size_int (lbitsize - 1), 0);
if (! integer_zerop (tem) && ! integer_all_onesp (tem))
{
warning ("comparison is always %d due to width of bit-field",
warning (0, "comparison is always %d due to width of bit-field",
code == NE_EXPR);
return constant_boolean_node (code == NE_EXPR, compare_type);
}
@ -4808,7 +4808,7 @@ fold_truthop (enum tree_code code, tree truth_type, tree lhs, tree rhs)
lntype, ll_mask),
0)))
{
warning ("comparison is always %d", wanted_code == NE_EXPR);
warning (0, "comparison is always %d", wanted_code == NE_EXPR);
return constant_boolean_node (wanted_code == NE_EXPR, truth_type);
}
@ -4823,7 +4823,7 @@ fold_truthop (enum tree_code code, tree truth_type, tree lhs, tree rhs)
lntype, rl_mask),
0)))
{
warning ("comparison is always %d", wanted_code == NE_EXPR);
warning (0, "comparison is always %d", wanted_code == NE_EXPR);
return constant_boolean_node (wanted_code == NE_EXPR, truth_type);
}
@ -4952,12 +4952,12 @@ fold_truthop (enum tree_code code, tree truth_type, tree lhs, tree rhs)
{
if (wanted_code == NE_EXPR)
{
warning ("%<or%> of unmatched not-equal tests is always 1");
warning (0, "%<or%> of unmatched not-equal tests is always 1");
return constant_boolean_node (true, truth_type);
}
else
{
warning ("%<and%> of mutually exclusive equal-tests is always 0");
warning (0, "%<and%> of mutually exclusive equal-tests is always 0");
return constant_boolean_node (false, truth_type);
}
}

View File

@ -1,3 +1,7 @@
2005-04-23 DJ Delorie <dj@redhat.com>
* trans-decl.c: Adjust warning() callers.
2005-04-23 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
* trans-const.c (gfc_conv_mpfr_to_tree): Use hexadecimal string as

View File

@ -1916,7 +1916,7 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, tree fnbody)
{
if (!current_fake_result_decl)
{
warning ("Function does not return a value");
warning (0, "Function does not return a value");
return fnbody;
}
@ -2111,12 +2111,12 @@ generate_local_decl (gfc_symbol * sym)
if (sym->attr.referenced)
gfc_get_symbol_decl (sym);
else if (sym->attr.dummy && warn_unused_parameter)
warning ("unused parameter %qs", sym->name);
warning (0, "unused parameter %qs", sym->name);
/* Warn for unused variables, but not if they're inside a common
block or are use-associated. */
else if (warn_unused_variable
&& !(sym->attr.in_common || sym->attr.use_assoc))
warning ("unused variable %qs", sym->name);
warning (0, "unused variable %qs", sym->name);
}
}
@ -2257,7 +2257,7 @@ gfc_generate_function_code (gfc_namespace * ns)
result = sym->result->backend_decl;
if (result == NULL_TREE)
warning ("Function return value not set");
warning (0, "Function return value not set");
else
{
/* Set the return value to the dummy result variable. */

View File

@ -3601,7 +3601,7 @@ setjmp_vars_warning (tree block)
&& DECL_RTL_SET_P (decl)
&& REG_P (DECL_RTL (decl))
&& regno_clobbered_at_setjmp (REGNO (DECL_RTL (decl))))
warning ("%Jvariable %qD might be clobbered by %<longjmp%>"
warning (0, "%Jvariable %qD might be clobbered by %<longjmp%>"
" or %<vfork%>",
decl, decl);
}
@ -3622,7 +3622,7 @@ setjmp_args_warning (void)
if (DECL_RTL (decl) != 0
&& REG_P (DECL_RTL (decl))
&& regno_clobbered_at_setjmp (REGNO (DECL_RTL (decl))))
warning ("%Jargument %qD might be clobbered by %<longjmp%> or %<vfork%>",
warning (0, "%Jargument %qD might be clobbered by %<longjmp%> or %<vfork%>",
decl, decl);
}
@ -4020,7 +4020,7 @@ init_function_start (tree subr)
regardless of which calling convention we are using for it. */
if (warn_aggregate_return
&& AGGREGATE_TYPE_P (TREE_TYPE (DECL_RESULT (subr))))
warning ("function returns an aggregate");
warning (0, "function returns an aggregate");
}
/* Make sure all values used by the optimization passes have sane
@ -4343,7 +4343,7 @@ do_warn_unused_parameter (tree fn)
decl; decl = TREE_CHAIN (decl))
if (!TREE_USED (decl) && TREE_CODE (decl) == PARM_DECL
&& DECL_NAME (decl) && !DECL_ARTIFICIAL (decl))
warning ("%Junused parameter %qD", decl, decl);
warning (0, "%Junused parameter %qD", decl, decl);
}
static GTY(()) rtx initial_trampoline;

View File

@ -6530,7 +6530,7 @@ is_too_expensive (const char *pass)
if (n_edges > 20000 + n_basic_blocks * 4)
{
if (warn_disabled_optimization)
warning ("%s: %d basic blocks and %d edges/basic block",
warning (0, "%s: %d basic blocks and %d edges/basic block",
pass, n_basic_blocks, n_edges / n_basic_blocks);
return true;
@ -6543,7 +6543,7 @@ is_too_expensive (const char *pass)
* sizeof (SBITMAP_ELT_TYPE)) > MAX_GCSE_MEMORY)
{
if (warn_disabled_optimization)
warning ("%s: %d basic blocks and %d registers",
warning (0, "%s: %d basic blocks and %d registers",
pass, n_basic_blocks, max_reg_num ());
return true;

View File

@ -2724,7 +2724,7 @@ add_presence_absence (unit_set_el_t dest_list,
}
else
warning
("unit `%s' excludes and requires presence of `%s'",
(0, "unit `%s' excludes and requires presence of `%s'",
dst->unit_decl->name, unit->name);
}
}
@ -2744,7 +2744,7 @@ add_presence_absence (unit_set_el_t dest_list,
}
else
warning
("unit `%s' requires absence and presence of `%s'",
(0, "unit `%s' requires absence and presence of `%s'",
dst->unit_decl->name, unit->name);
}
if (no_error_flag)
@ -2826,7 +2826,7 @@ process_decls (void)
error ("repeated declaration of automaton `%s'",
DECL_AUTOMATON (decl)->name);
else
warning ("repeated declaration of automaton `%s'",
warning (0, "repeated declaration of automaton `%s'",
DECL_AUTOMATON (decl)->name);
}
}
@ -2946,7 +2946,7 @@ process_decls (void)
DECL_BYPASS (decl)->in_insn_name);
else
warning
("the same bypass `%s - %s' is already defined",
(0, "the same bypass `%s - %s' is already defined",
DECL_BYPASS (decl)->out_insn_name,
DECL_BYPASS (decl)->in_insn_name);
}
@ -3056,7 +3056,7 @@ check_automaton_usage (void)
if (!w_flag)
error ("automaton `%s' is not used", DECL_AUTOMATON (decl)->name);
else
warning ("automaton `%s' is not used",
warning (0, "automaton `%s' is not used",
DECL_AUTOMATON (decl)->name);
}
}
@ -3170,14 +3170,14 @@ check_usage (void)
if (!w_flag)
error ("unit `%s' is not used", DECL_UNIT (decl)->name);
else
warning ("unit `%s' is not used", DECL_UNIT (decl)->name);
warning (0, "unit `%s' is not used", DECL_UNIT (decl)->name);
}
else if (decl->mode == dm_reserv && !DECL_RESERV (decl)->reserv_is_used)
{
if (!w_flag)
error ("reservation `%s' is not used", DECL_RESERV (decl)->name);
else
warning ("reservation `%s' is not used", DECL_RESERV (decl)->name);
warning (0, "reservation `%s' is not used", DECL_RESERV (decl)->name);
}
}
}
@ -9818,7 +9818,7 @@ check_automata_insn_issues (void)
reserv_ainsn->insn_reserv_decl->name);
else
warning
("Automaton `%s': Insn `%s' will never be issued",
(0, "Automaton `%s': Insn `%s' will never be issued",
automaton->corresponding_automaton_decl->name,
reserv_ainsn->insn_reserv_decl->name);
}
@ -9828,7 +9828,7 @@ check_automata_insn_issues (void)
error ("Insn `%s' will never be issued",
reserv_ainsn->insn_reserv_decl->name);
else
warning ("Insn `%s' will never be issued",
warning (0, "Insn `%s' will never be issued",
reserv_ainsn->insn_reserv_decl->name);
}
}

View File

@ -179,7 +179,7 @@ fix_sched_param (const char *param, const char *val)
if (!strcmp (param, "verbose"))
sched_verbose_param = atoi (val);
else
warning ("fix_sched_param: unknown param: %s", param);
warning (0, "fix_sched_param: unknown param: %s", param);
}
struct haifa_insn_data *h_i_d;

View File

@ -1,3 +1,8 @@
2005-04-23 DJ Delorie <dj@redhat.com>
* class.c, decl.c, expr.c, jcf-io.c, jcf-parse.c, jv-scan.c,
parse.y: Adjust warning() callers.
2005-04-21 Bryce McKinlay <mckinlay@redhat.com>
* gcj.texi (Object fields): Change "Integer" to "Int" in example

View File

@ -788,9 +788,9 @@ void
set_constant_value (tree field, tree constant)
{
if (field == NULL_TREE)
warning ("misplaced ConstantValue attribute (not in any field)");
warning (0, "misplaced ConstantValue attribute (not in any field)");
else if (DECL_INITIAL (field) != NULL_TREE)
warning ("duplicate ConstantValue attribute for field '%s'",
warning (0, "duplicate ConstantValue attribute for field '%s'",
IDENTIFIER_POINTER (DECL_NAME (field)));
else
{
@ -1417,7 +1417,7 @@ get_dispatch_table (tree type, tree this_class_addr)
if (METHOD_ABSTRACT (method))
{
if (! abstract_p)
warning ("%Jabstract method in non-abstract class", method);
warning (0, "%Jabstract method in non-abstract class", method);
if (TARGET_VTABLE_USES_DESCRIPTORS)
for (j = 0; j < TARGET_VTABLE_USES_DESCRIPTORS; ++j)

View File

@ -1346,7 +1346,7 @@ pushdecl (tree x)
warnstring = "declaration of %qs shadows global declaration";
if (warnstring)
warning (warnstring, IDENTIFIER_POINTER (name));
warning (0, warnstring, IDENTIFIER_POINTER (name));
}
#endif
@ -1649,7 +1649,7 @@ poplevel (int keep, int reverse, int functionbody)
define_label (input_location, DECL_NAME (label));
}
else if (warn_unused[UNUSED_LABEL] && !TREE_USED (label))
warning ("%Jlabel '%D' defined but not used", label, label);
warning (0, "%Jlabel '%D' defined but not used", label, label);
IDENTIFIER_LABEL_VALUE (DECL_NAME (label)) = 0;
/* Put the labels into the "variables" of the
@ -1777,7 +1777,7 @@ force_poplevels (int start_pc)
while (current_binding_level->start_pc > start_pc)
{
if (pedantic && current_binding_level->start_pc > start_pc)
warning ("%JIn %D: overlapped variable and exception ranges at %d",
warning (0, "%JIn %D: overlapped variable and exception ranges at %d",
current_function_decl, current_function_decl,
current_binding_level->start_pc);
poplevel (1, 0, 0);
@ -1841,7 +1841,7 @@ give_name_to_locals (JCF *jcf)
DECL_NAME (decl) = name;
SET_DECL_ASSEMBLER_NAME (decl, name);
if (TREE_CODE (decl) != PARM_DECL || TREE_TYPE (decl) != type)
warning ("bad type in parameter debug info");
warning (0, "bad type in parameter debug info");
}
else
{
@ -1850,7 +1850,7 @@ give_name_to_locals (JCF *jcf)
tree decl = build_decl (VAR_DECL, name, type);
if (end_pc > DECL_CODE_LENGTH (current_function_decl))
{
warning ("%Jbad PC range for debug info for local '%D'",
warning (0, "%Jbad PC range for debug info for local '%D'",
decl, decl);
end_pc = DECL_CODE_LENGTH (current_function_decl);
}

View File

@ -373,7 +373,7 @@ pop_type_0 (tree type, char **messagep)
&& t == object_ptr_type_node)
{
if (type != ptr_type_node)
warning ("need to insert runtime check for %s",
warning (0, "need to insert runtime check for %s",
xstrdup (lang_printable_name (type, 0)));
return type;
}
@ -502,7 +502,7 @@ can_widen_reference_to (tree source_type, tree target_type)
source_type, target_type);
if (!quiet_flag)
warning ("assert: %s is assign compatible with %s",
warning (0, "assert: %s is assign compatible with %s",
xstrdup (lang_printable_name (target_type, 0)),
xstrdup (lang_printable_name (source_type, 0)));
/* Punt everything to runtime. */
@ -549,7 +549,7 @@ can_widen_reference_to (tree source_type, tree target_type)
if (TYPE_DUMMY (source_type) || TYPE_DUMMY (target_type))
{
if (! quiet_flag)
warning ("assert: %s is assign compatible with %s",
warning (0, "assert: %s is assign compatible with %s",
xstrdup (lang_printable_name (target_type, 0)),
xstrdup (lang_printable_name (source_type, 0)));
return 1;
@ -2728,7 +2728,7 @@ expand_java_field_op (int is_static, int is_putting, int field_ref_index)
else if (FIELD_STATIC (field_decl))
{
if (!DECL_CLINIT_P (current_function_decl))
warning ("%Jassignment to final static field %qD not in "
warning (0, "%Jassignment to final static field %qD not in "
"class initializer",
field_decl, field_decl);
}
@ -2737,7 +2737,7 @@ expand_java_field_op (int is_static, int is_putting, int field_ref_index)
tree cfndecl_name = DECL_NAME (current_function_decl);
if (! DECL_CONSTRUCTOR_P (current_function_decl)
&& !ID_FINIT_P (cfndecl_name))
warning ("%Jassignment to final field '%D' not in constructor",
warning (0, "%Jassignment to final field '%D' not in constructor",
field_decl, field_decl);
}
}
@ -2927,7 +2927,7 @@ expand_byte_code (JCF *jcf, tree method)
int pc = GET_u2 (linenumber_pointer);
linenumber_pointer += 4;
if (pc >= length)
warning ("invalid PC in line number table");
warning (0, "invalid PC in line number table");
else
{
if ((instruction_bits[pc] & BCODE_HAS_LINENUMBER) != 0)
@ -2983,7 +2983,7 @@ expand_byte_code (JCF *jcf, tree method)
{
/* We've just reached the end of a region of dead code. */
if (extra_warnings)
warning ("unreachable bytecode from %d to before %d",
warning (0, "unreachable bytecode from %d to before %d",
dead_code_index, PC);
dead_code_index = -1;
}
@ -3025,7 +3025,7 @@ expand_byte_code (JCF *jcf, tree method)
{
/* We've just reached the end of a region of dead code. */
if (extra_warnings)
warning ("unreachable bytecode from %d to the end of the method",
warning (0, "unreachable bytecode from %d to the end of the method",
dead_code_index);
}
}

View File

@ -533,7 +533,7 @@ find_class (const char *classname, int classname_length, JCF *jcf,
if (! java && ! class && java_buf.st_mtime > class_buf.st_mtime)
{
if (flag_newer)
warning ("source file for class %qs is newer than its matching class file. Source file %qs used instead", classname, java_buffer);
warning (0, "source file for class %qs is newer than its matching class file. Source file %qs used instead", classname, java_buffer);
class = -1;
}

View File

@ -717,8 +717,8 @@ load_class (tree class_or_name, int verbose)
{
/* This is just a diagnostic during testing, not a real problem. */
if (!quiet_flag)
warning("cannot find file for class %s",
IDENTIFIER_POINTER (saved));
warning (0, "cannot find file for class %s",
IDENTIFIER_POINTER (saved));
/* Fake it. */
if (TREE_CODE (class_or_name) == RECORD_TYPE)
@ -833,7 +833,7 @@ duplicate_class_warning (const char *filename)
warn_loc.file = filename;
warn_loc.line = 0;
#endif
warning ("%Hduplicate class will only be compiled once", &warn_loc);
warning (0, "%Hduplicate class will only be compiled once", &warn_loc);
}
static void
@ -1154,7 +1154,7 @@ java_parse_file (int set_yydebug ATTRIBUTE_UNUSED)
free (file_list);
if (filename_count == 0)
warning ("no input file specified");
warning (0, "no input file specified");
if (resource_name)
{

View File

@ -42,7 +42,8 @@ Boston, MA 02111-1307, USA. */
extern void fatal_error (const char *msgid, ...)
ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
void warning (const char *msgid, ...) ATTRIBUTE_PRINTF_1;
void warning (int opt, const char *msgid, ...) ATTRIBUTE_PRINTF_2;
void warning0 (const char *msgid, ...) ATTRIBUTE_PRINTF_1;
void report (void);
static void usage (void) ATTRIBUTE_NORETURN;
@ -256,7 +257,18 @@ fatal_error (const char *msgid, ...)
}
void
warning (const char *msgid, ...)
warning (int opt ATTRIBUTE_UNUSED, const char *msgid, ...)
{
va_list ap;
va_start (ap, msgid);
fprintf (stderr, _("%s: warning: "), exec_name);
vfprintf (stderr, _(msgid), ap);
fputc ('\n', stderr);
va_end (ap);
}
void
warning0 (const char *msgid, ...)
{
va_list ap;
va_start (ap, msgid);

View File

@ -3106,7 +3106,7 @@ yyerror (const char *msgid)
code_from_source, strlen (code_from_source));
remainder = obstack_finish (&temporary_obstack);
if (do_warning)
warning ("%s.\n%s", msgid, remainder);
warning (0, "%s.\n%s", msgid, remainder);
else
error ("%s.\n%s", msgid, remainder);

Some files were not shown because too many files have changed in this diff Show More