+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
+2005-04-23 DJ Delorie <dj@redhat.com>
+
+ * misc.c: Adjust warning() callers.
+
2005-04-16 Laurent GUERBY <laurent@guerby.net>
PR ada/18847
break;
case OPT_gant:
- warning ("%<-gnat%> misspelled as %<-gant%>");
+ warning (0, "%<-gnat%> misspelled as %<-gant%>");
/* ... fall through ... */
if (spec == NULL)
{
- warning ("%qs attribute directive ignored",
+ warning (0, "%qs attribute directive ignored",
IDENTIFIER_POINTER (name));
continue;
}
}
else
{
- warning ("%qs attribute does not apply to types",
+ warning (0, "%qs attribute does not apply to types",
IDENTIFIER_POINTER (name));
continue;
}
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;
}
runtime. */
if (offset < 0 || offset > max)
{
- warning ("offset outside bounds of constant string");
+ warning (0, "offset outside bounds of constant string");
return 0;
}
/* 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;
}
/* 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;
}
/* 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);
}
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;
}
{
/* 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)
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,
{
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
{
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");
}
}
{
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");
}
}
|| !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);
&& 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;
}
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;
}
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;
}
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;
}
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;
}
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)
&& !(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;
&& !(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;
{
/* 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;
}
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:
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,
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);
}
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.
{
/* 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));
}
}
that changes what the typedef is typing. */
else
{
- warning ("%qE attribute ignored", name);
+ warning (0, "%qE attribute ignored", name);
*no_add_attrs = true;
}
DECL_COMMON (*node) = 0;
else
{
- warning ("%qE attribute ignored", name);
+ warning (0, "%qE attribute ignored", name);
*no_add_attrs = true;
}
DECL_COMMON (*node) = 1;
else
{
- warning ("%qE attribute ignored", name);
+ warning (0, "%qE attribute ignored", name);
*no_add_attrs = true;
}
TYPE_READONLY (TREE_TYPE (type)), 1));
else
{
- warning ("%qE attribute ignored", name);
+ warning (0, "%qE attribute ignored", name);
*no_add_attrs = true;
}
DECL_UNINLINABLE (*node) = 1;
else
{
- warning ("%qE attribute ignored", name);
+ warning (0, "%qE attribute ignored", name);
*no_add_attrs = true;
}
}
else
{
- warning ("%qE attribute ignored", name);
+ warning (0, "%qE attribute ignored", name);
*no_add_attrs = true;
}
}
else
{
- warning ("%qE attribute ignored", name);
+ warning (0, "%qE attribute ignored", name);
*no_add_attrs = true;
}
TREE_USED (decl) = 1;
else
{
- warning ("%qE attribute ignored", name);
+ warning (0, "%qE attribute ignored", name);
*no_add_attrs = true;
}
}
TREE_THIS_VOLATILE (TREE_TYPE (type))));
else
{
- warning ("%qE attribute ignored", name);
+ warning (0, "%qE attribute ignored", name);
*no_add_attrs = true;
}
DECL_TRANSPARENT_UNION (decl) = 1;
else
{
- warning ("%qE attribute ignored", name);
+ warning (0, "%qE attribute ignored", name);
*no_add_attrs = true;
}
}
else
{
- warning ("%qE attribute ignored", name);
+ warning (0, "%qE attribute ignored", name);
*no_add_attrs = true;
}
}
else
{
- warning ("%qE attribute ignored", name);
+ warning (0, "%qE attribute ignored", name);
*no_add_attrs = true;
}
*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;
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;
}
else
{
- warning ("%qE attribute ignored", name);
+ warning (0, "%qE attribute ignored", name);
*no_add_attrs = true;
}
{
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;
}
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;
}
if (!DECL_THREAD_LOCAL (decl))
{
- warning ("%qE attribute ignored", name);
+ warning (0, "%qE attribute ignored", name);
*no_add_attrs = true;
}
else
DECL_IS_MALLOC (*node) = 1;
else
{
- warning ("%qE attribute ignored", name);
+ warning (0, "%qE attribute ignored", name);
*no_add_attrs = true;
}
DECL_IS_RETURNS_TWICE (*node) = 1;
else
{
- warning ("%qE attribute ignored", name);
+ warning (0, "%qE attribute ignored", name);
*no_add_attrs = true;
}
/* ??? TODO: Support types. */
else
{
- warning ("%qE attribute ignored", name);
+ warning (0, "%qE attribute ignored", name);
*no_add_attrs = true;
}
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;
if (!host_integerp (size, 1))
{
- warning ("%qE attribute ignored", name);
+ warning (0, "%qE attribute ignored", name);
return NULL_TREE;
}
if (attr)
{
if (!params)
- warning ("missing sentinel in function call");
+ warning (0, "missing sentinel in function call");
else
{
tree sentinel, end;
}
if (pos > 0)
{
- warning ("not enough arguments to fit a sentinel");
+ warning (0, "not enough arguments to fit a sentinel");
return;
}
/* 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");
}
}
}
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);
}
/* ??? TODO: Support types. */
else
{
- warning ("%qE attribute ignored", name);
+ warning (0, "%qE attribute ignored", name);
*no_add_attrs = true;
}
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;
}
/* 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;
}
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
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;
}
}
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;
}
}
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));
}
&& !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);
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);
&& !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)
{
/* 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
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;
}
/* 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;
}
&& !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;
}
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;
}
}
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;
}
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;
}
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;
}
{
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;
}
&& !(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;
}
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;
}
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))
{
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 ();
}
(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);
}
}
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);
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;
}
|| declspecs->volatile_p
|| declspecs->restrict_p))
{
- warning ("useless type qualifier in empty declaration");
+ warning (0, "useless type qualifier in empty declaration");
warned = 2;
}
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;
}
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?
&& 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. */
&& 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));
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);
}
}
\f
{
/* '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);
}
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);
}
/* 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;
}
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
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 */
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);
}
}
{
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;
}
&& 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
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;
}
}
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);
&& 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
&& 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
&& 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.
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.
#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. */
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;
/* 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. */
&& 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:
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;
}
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);
}
}
{
if (dollar_needed)
{
- warning ("missing $ operand number in format");
+ warning (0, "missing $ operand number in format");
return -1;
}
else
{
if (dollar_needed)
{
- warning ("missing $ operand number in format");
+ warning (0, "missing $ operand number in format");
return -1;
}
else
*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)
&& 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
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;
|| 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);
}
}
/* 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)
{
++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");
}
}
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
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)
{
continue;
if (*format_chars == 0)
{
- warning ("spurious trailing %<%%%> in format");
+ warning (0, "spurious trailing %<%%%> in format");
continue;
}
if (*format_chars == '%')
*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
{
++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;
}
}
{
if (params == 0)
{
- warning ("too few arguments for format");
+ warning (0, "too few arguments for format");
return;
}
cur_param = TREE_VALUE (params);
}
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);
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;
}
{
if (params == 0)
{
- warning ("too few arguments for format");
+ warning (0, "too few arguments for format");
return;
}
cur_param = TREE_VALUE (params);
{
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;
}
{
/* 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);
}
{
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
{
|| (!(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++;
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);
}
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;
{
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))
? 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);
}
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);
}
}
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)
++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;
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);
&& 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);
}
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
++arg_num;
if (has_operand_number > 0)
{
- warning ("missing $ operand number in format");
+ warning (0, "missing $ operand number in format");
return;
}
else
{
if (params == 0)
{
- warning ("too few arguments for format");
+ warning (0, "too few arguments for format");
return;
}
&& 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. */
&& 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)
&& (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
&& (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);
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);
}
}
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);
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
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);
}
}
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");
}
}
}
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)
&& 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;
}
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;
}
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;
}
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:
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;
/* 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. */
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;
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
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);
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);
#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(())
{
break;
}
if (entry == NULL)
- warning ("\
+ warning (0, "\
#pragma pack(pop, %s) encountered without matching #pragma pack(push, %s)"
, IDENTIFIER_POINTER (id), IDENTIFIER_POINTER (id));
}
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");
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);
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))
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;
}
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
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;
}
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
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. */
{
/* 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);
{
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;
}
}
}
if (c_lex (&x) != CPP_EOF)
- warning ("junk at end of %<#pragma GCC visibility%>");
+ warning (0, "junk at end of %<#pragma GCC visibility%>");
}
#endif
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;
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
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);
/* 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. */
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
/* 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);
}
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))
;
&& 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);
}
}
{
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)
|| 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)
|| 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");
}
|| (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");
}
}
}
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
&& 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. */
|| 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
&& 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
/* 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");
}
}
pedwarn (AR, parmnum, rname); \
break; \
case ic_argpass_nonproto: \
- warning (AR, parmnum, rname); \
+ warning (0, AR, parmnum, rname); \
break; \
case ic_assign: \
pedwarn (AS); \
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;
{
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);
}
\f
/* If TYPE is an array type and EXPR is a parenthesized string
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
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)
{
&& !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:
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);
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);
}
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 ();
}
&& 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 ();
}
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)
/* 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)
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)
{
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");
}
}
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. */
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;
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
{
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
< 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");
}
}
}
/* 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
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);
}
/* 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;
}
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;
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;
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;
}
{
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;
}
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;
}
}
else
{
- warning ("bad value %qs for -mmemory-latency", alpha_mlat_string);
+ warning (0, "bad value %qs for -mmemory-latency", alpha_mlat_string);
lat = 3;
}
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;
}
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;
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;
}
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;
}
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. */
&& 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. */
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;
|| (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");
}
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]
{
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;
}
{
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;
}
{
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;
}
}
}
else
{
- warning ("%qs attribute ignored", IDENTIFIER_POINTER (name));
+ warning (0, "%qs attribute ignored", IDENTIFIER_POINTER (name));
}
}
}
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 */
}
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). */
{
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;
}
}
{
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;
}
{
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);
}
}
{
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);
}
}
&& 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");
}
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;
}
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)
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;
{
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;
}
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;
}
}
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. */
/* 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;
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"))
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}*]) */
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 {
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);
{
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
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");
}
do { \
if (ALIAS) \
{ \
- warning ("alias definitions not supported in Mach-O; ignored"); \
+ warning (0, "alias definitions not supported in Mach-O; ignored"); \
break; \
} \
\
{
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
{
- warning ("%qs attribute ignored", IDENTIFIER_POINTER (name));
+ warning (0, "%qs attribute ignored", IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
}
else
{
- warning ("%qs attribute ignored", IDENTIFIER_POINTER (name));
+ warning (0, "%qs attribute ignored", IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
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; \
} \
{ \
if (TARGET_BNU210) \
{ \
- warning ("-mbnu210 is ignored (option is obsolete)"); \
+ warning (0, "-mbnu210 is ignored (option is obsolete)"); \
} \
} \
while (0)
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);
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);
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);
{
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_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
&& 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;
}
if (TARGET_64BIT)
{
- warning ("%qs attribute ignored", IDENTIFIER_POINTER (name));
+ warning (0, "%qs attribute ignored", IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
&& 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;
}
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;
}
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)
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)
|| (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");
}
}
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;
}
|| ((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;
}
{
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;
}
{
/* 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;
}
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;
}
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);
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);
}
}
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
}
else
{
- warning ("invalid argument of %qs attribute",
+ warning (0, "invalid argument of %qs attribute",
IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
break;
default:
- warning ("%qs attribute ignored", IDENTIFIER_POINTER (name));
+ warning (0, "%qs attribute ignored", IDENTIFIER_POINTER (name));
*no_add_attrs = true;
break;
}
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';
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;
}
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;
}
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;
}
{
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;
}
}
{
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;
}
&& 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;
}
/* 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;
}
}
else
{
- warning ("%qs attribute ignored", IDENTIFIER_POINTER (name));
+ warning (0, "%qs attribute ignored", IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
&& 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;
}
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);
}
{
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;
}
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)
}
else
{
- warning ("%qs attribute only applies to functions",
+ warning (0, "%qs attribute only applies to functions",
IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
/* 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");
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)
{
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
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;
}
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;
}
}
&& 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;
}
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) \
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';
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;
}
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;
}
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;
}
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;
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) \
{ \
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) \
{ \
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) \
{ \
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)
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)
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);
}
{
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");
}
}
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"))
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;
}
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;
}
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;
}
if (INTVAL (todec) != -size)
{
- warning ("stack frame too large");
+ warning (0, "stack frame too large");
emit_insn (gen_trap ());
return;
}
const0_rtx));
}
else
- warning ("stack limit expression is not supported");
+ warning (0, "stack limit expression is not supported");
}
if (copy_r12 || ! TARGET_UPDATE)
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);
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)
&& 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;
}
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)
{
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;
}
{
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;
}
{
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;
}
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; \
} \
} \
{
/* 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;
}
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;
}
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))
| (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;
}
if (c_lex (&x) != CPP_NUMBER
|| c_lex (&t) != CPP_OPEN_PAREN)
{
- warning ("malformed %<#pragma align%>, ignoring");
+ warning (0, "malformed %<#pragma align%>, ignoring");
return;
}
|| (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;
}
{
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),
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;
}
}
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;
}
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;
}
}
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;
}
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;
}
}
{
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,
{
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;
}
&& 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;
}
}
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;
if (current_function_decl == NULL_TREE)
{
- warning ("cannot set interrupt attribute: no current function");
+ warning (0, "cannot set interrupt attribute: no current function");
return;
}
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;
}
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;
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;
}
return;
bad:
- warning ("malformed #pragma ghs section");
+ warning (0, "malformed #pragma ghs section");
return;
reset:
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 ();
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
{
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;
}
&& 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");
}
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;
}
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;
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;
}
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;
}
+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
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);
&& (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;
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
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. */
&& 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. */
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);
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,
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),
|| 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);
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);
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);
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
}
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;
}
}
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;
}
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;
}
&& 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);
}
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));
}
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);
}
}
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);
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);
}
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);
}
}
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);
&& 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
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);
}
&& (!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);
}
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
{
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);
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)
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;
}
}
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);
}
/* 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;
|| 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);
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);
&& ! 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))
&& 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);
}
}
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. */
/* 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
{
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);
}
{
/* 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))
&& ! 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);
}
}
}
/* 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);
}
}
&& 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))
{
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 ())
&& 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)))
{
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);
}
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;
&& 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;
}
&& 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);
}
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 "
}
}
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
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;
}
/* 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);
{
/* 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)
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);
}
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);
}
}
}
&& (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);
}
|| 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;
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
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. */
/* 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. */
/* 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);
/* 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;
}
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;
}
}
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)
{
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;
}
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;
}
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;
}
}
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;
}
}
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");
/* 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)
{
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);
}
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. */
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));
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
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 "
{
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;
}
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
}
{
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);
}
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);
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);
/* 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);
}
}
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);
}
}
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);
}
}
}
{
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);
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))
DECL_NAMESPACE_ASSOCIATIONS (namespace));
}
else
- warning ("%qD attribute directive ignored", name);
+ warning (0, "%qD attribute directive ignored", name);
}
}
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
&& !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. */
/* 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);
/* 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);
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. */
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");
if (p && ! compiling)
{
- warning ("-frepo must be used with -c");
+ warning (0, "-frepo must be used with -c");
flag_use_repository = 0;
return NULL;
}
&& 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;
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;
|| !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;
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)
/* 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;
}
&& !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
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)))
{
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));
|| 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)));
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)
{
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
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. */
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
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
&& 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));
}
(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
{
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
< 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");
}
}
}
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)
{
}
}
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);
}
}
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;
{
/* 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
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);
&& 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);
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)
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));
{
/* 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",
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;
}
}
(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))
&& !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. */
}
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:
if (diag_type == 1)
{
- p_msg = warning;
+ p_msg = warning0;
p_msg_at = cp_warning_at;
}
else if (diag_type == 2)
if (elts)
{
if (warn_missing_braces)
- warning ("aggregate has a partly bracketed initializer");
+ warning (0, "aggregate has a partly bracketed initializer");
tail = *elts;
}
else
/* 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
{
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),
/* 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;
|| (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
/* 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;
#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;
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);
}
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);
}
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);
}
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);
}
{
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);
}
}
+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
{
if (!current_fake_result_decl)
{
- warning ("Function does not return a value");
+ warning (0, "Function does not return a value");
return fnbody;
}
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);
}
}
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. */
&& 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);
}
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);
}
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
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;
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;
* 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;
}
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);
}
}
}
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)
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);
}
}
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);
}
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);
}
}
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);
}
}
}
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);
}
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);
}
}
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;
+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
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
{
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)
warnstring = "declaration of %qs shadows global declaration";
if (warnstring)
- warning (warnstring, IDENTIFIER_POINTER (name));
+ warning (0, warnstring, IDENTIFIER_POINTER (name));
}
#endif
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
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);
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
{
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);
}
&& 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;
}
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. */
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;
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);
}
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);
}
}
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)
{
/* 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;
}
{
/* 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);
}
}
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;
}
{
/* 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)
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
free (file_list);
if (filename_count == 0)
- warning ("no input file specified");
+ warning (0, "no input file specified");
if (resource_name)
{
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;
}
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);
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);
+2005-04-23 DJ Delorie <dj@redhat.com>
+
+ * objc-act.c: Adjust warning() callers.
+
2005-04-21 Roger Sayle <roger@eyesopen.com>
* objc-act.h (METHOD_ADD_ARGS_ELLIPSIS_P): New macro for accessing
objc_implementation_context = NULL_TREE;
}
else
- warning ("%<@end%> must appear in an @implementation context");
+ warning (0, "%<@end%> must appear in an @implementation context");
}
void
if (!rproto)
warning
- ("object does not conform to the %qs protocol",
+ (0, "object does not conform to the %qs protocol",
IDENTIFIER_POINTER (PROTOCOL_NAME (p)));
}
return 1;
}
if (!rproto)
- warning ("class %qs does not implement the %qs protocol",
+ warning (0, "class %qs does not implement the %qs protocol",
IDENTIFIER_POINTER (OBJC_TYPE_NAME (TREE_TYPE (rhs))),
IDENTIFIER_POINTER (PROTOCOL_NAME (p)));
}
}
if (!lproto)
- warning ("class %qs does not implement the %qs protocol",
+ warning (0, "class %qs does not implement the %qs protocol",
IDENTIFIER_POINTER (OBJC_TYPE_NAME
(TREE_TYPE (lhs))),
IDENTIFIER_POINTER (PROTOCOL_NAME (p)));
loc = &DECL_SOURCE_LOCATION (TREE_PURPOSE (chain));
else
loc = &input_location;
- warning ("%Hcreating selector for nonexistent method %qE",
+ warning (0, "%Hcreating selector for nonexistent method %qE",
loc, TREE_VALUE (chain));
}
}
#endif /* OBJCPLUS */
if (!(underlying_class = objc_is_class_name (class_ident)))
- warning ("cannot find class %qs", IDENTIFIER_POINTER (class_ident));
+ warning (0, "cannot find class %qs", IDENTIFIER_POINTER (class_ident));
else if (objc_is_class_name (alias_ident))
- warning ("class %qs already exists", IDENTIFIER_POINTER (alias_ident));
+ warning (0, "class %qs already exists", IDENTIFIER_POINTER (alias_ident));
else
alias_chain = tree_cons (underlying_class, alias_ident, alias_chain);
}
/* On Darwin, ObjC exceptions require a sufficiently recent
version of the runtime, so the user must ask for them explicitly. */
if (!flag_objc_exceptions)
- warning ("use %<-fobjc-exceptions%> to enable Objective-C "
+ warning (0, "use %<-fobjc-exceptions%> to enable Objective-C "
"exception syntax");
}
#ifndef OBJCPLUS
continue;
if (!t || objc_comptypes (TREE_TYPE (t), TREE_TYPE (type), 0) == 1)
{
- warning ("exception of type %<%T%> will be caught",
+ warning (0, "exception of type %<%T%> will be caught",
TREE_TYPE (type));
- warning ("%H by earlier handler for %<%T%>",
+ warning (0, "%H by earlier handler for %<%T%>",
EXPR_LOCUS (stmt), TREE_TYPE (t ? t : objc_object_type));
break;
}
different types. */
attr loop;
- warning ("multiple %s named %<%c%s%> found",
+ warning (0, "multiple %s named %<%c%s%> found",
methods ? "methods" : "selectors",
(is_class ? '+' : '-'),
IDENTIFIER_POINTER (METHOD_SEL_NAME (meth)));
= lookup_method_in_protocol_list (rprotos, sel_name, 0);
if (method_prototype)
- warning ("found %<-%s%> instead of %<+%s%> in protocol(s)",
+ warning (0, "found %<-%s%> instead of %<+%s%> in protocol(s)",
IDENTIFIER_POINTER (sel_name),
IDENTIFIER_POINTER (sel_name));
}
}
else
{
- warning ("invalid receiver type %qs",
+ warning (0, "invalid receiver type %qs",
gen_type_name (orig_rtype));
/* After issuing the "invalid receiver" warning, perform method
lookup as if we were messaging 'id'. */
if (!method_prototype)
{
if (rprotos)
- warning ("%<%c%s%> not found in protocol(s)",
+ warning (0, "%<%c%s%> not found in protocol(s)",
(class_tree ? '+' : '-'),
IDENTIFIER_POINTER (sel_name));
static bool warn_missing_methods = false;
if (rtype)
- warning ("%qs may not respond to %<%c%s%>",
+ warning (0, "%qs may not respond to %<%c%s%>",
IDENTIFIER_POINTER (OBJC_TYPE_NAME (rtype)),
(class_tree ? '+' : '-'),
IDENTIFIER_POINTER (sel_name));
then we have failed to find _any_ instance or class method,
respectively. */
else
- warning ("no %<%c%s%> method found",
+ warning (0, "no %<%c%s%> method found",
(class_tree ? '+' : '-'),
IDENTIFIER_POINTER (sel_name));
if (!warn_missing_methods)
{
- warning ("(Messages without a matching method signature");
- warning ("will be assumed to return %<id%> and accept");
- warning ("%<...%> as arguments.)");
+ warning (0, "(Messages without a matching method signature");
+ warning (0, "will be assumed to return %<id%> and accept");
+ warning (0, "%<...%> as arguments.)");
warn_missing_methods = true;
}
}
/* If still not found, print out a warning. */
if (!hsh)
{
- warning ("undeclared selector %qs", IDENTIFIER_POINTER (selname));
+ warning (0, "undeclared selector %qs", IDENTIFIER_POINTER (selname));
}
}
to an instance variable. It's better to catch the cases
where this is done unknowingly than to support the above
paradigm. */
- warning ("instance variable %qs accessed in class method",
+ warning (0, "instance variable %qs accessed in class method",
IDENTIFIER_POINTER (id));
self_decl = convert (objc_instance_type, self_decl); /* cast */
}
if (cat)
{
- warning ("duplicate interface declaration for category %<%s(%s)%>",
+ warning (0, "duplicate interface declaration for category %<%s(%s)%>",
IDENTIFIER_POINTER (CLASS_NAME (class)),
IDENTIFIER_POINTER (CLASS_SUPER_NAME (category)));
}
/* user-defined constructors and destructors are not known to Obj-C and
hence will not be called. This may or may not be a problem. */
if (TYPE_NEEDS_CONSTRUCTING (field_type))
- warning ("type %qs has a user-defined constructor", type_name);
+ warning (0, "type %qs has a user-defined constructor", type_name);
if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (field_type))
- warning ("type %qs has a user-defined destructor", type_name);
- warning ("C++ constructors and destructors will not be invoked for Objective-C fields");
+ warning (0, "type %qs has a user-defined destructor", type_name);
+ warning (0, "C++ constructors and destructors will not be invoked for Objective-C fields");
}
#endif
non-@public ivars. We will let this slide for now... */
if (!objc_method_context)
{
- warning ("instance variable %qs is %s; "
+ warning (0, "instance variable %qs is %s; "
"this will be a hard error in the future",
IDENTIFIER_POINTER (identifier),
TREE_PRIVATE (decl) ? "@private" : "@protected");
else if (objc_implementation_context && (basetype == objc_object_reference))
{
expr = convert (uprivate_record, expr);
- warning ("static access to object of type %<id%>");
+ warning (0, "static access to object of type %<id%>");
}
}
{
if (TREE_CODE (objc_implementation_context)
== CLASS_IMPLEMENTATION_TYPE)
- warning ("incomplete implementation of class %qs",
+ warning (0, "incomplete implementation of class %qs",
IDENTIFIER_POINTER (CLASS_NAME (objc_implementation_context)));
else if (TREE_CODE (objc_implementation_context)
== CATEGORY_IMPLEMENTATION_TYPE)
- warning ("incomplete implementation of category %qs",
+ warning (0, "incomplete implementation of category %qs",
IDENTIFIER_POINTER (CLASS_SUPER_NAME (objc_implementation_context)));
first = 0;
}
- warning ("method definition for %<%c%s%> not found",
+ warning (0, "method definition for %<%c%s%> not found",
mtype, IDENTIFIER_POINTER (METHOD_SEL_NAME (chain)));
}
{
if (TREE_CODE (objc_implementation_context)
== CLASS_IMPLEMENTATION_TYPE)
- warning ("incomplete implementation of class %qs",
+ warning (0, "incomplete implementation of class %qs",
IDENTIFIER_POINTER
(CLASS_NAME (objc_implementation_context)));
else if (TREE_CODE (objc_implementation_context)
== CATEGORY_IMPLEMENTATION_TYPE)
- warning ("incomplete implementation of category %qs",
+ warning (0, "incomplete implementation of category %qs",
IDENTIFIER_POINTER
(CLASS_SUPER_NAME (objc_implementation_context)));
first = 0;
}
- warning ("method definition for %<%c%s%> not found",
+ warning (0, "method definition for %<%c%s%> not found",
mtype, IDENTIFIER_POINTER (METHOD_SEL_NAME (chain)));
}
}
if (!f1 || !f2)
- warning ("%s %qs does not fully implement the %qs protocol",
+ warning (0, "%s %qs does not fully implement the %qs protocol",
type, name, IDENTIFIER_POINTER (PROTOCOL_NAME (p)));
}
if (objc_implementation_context)
{
- warning ("%<@end%> missing in implementation context");
+ warning (0, "%<@end%> missing in implementation context");
finish_class (objc_implementation_context);
objc_ivar_chain = NULL_TREE;
objc_implementation_context = NULL_TREE;
if (!(implementation_template = lookup_interface (class_name)))
{
- warning ("cannot find interface declaration for %qs",
+ warning (0, "cannot find interface declaration for %qs",
IDENTIFIER_POINTER (class_name));
add_class (implementation_template = objc_implementation_context);
}
#ifdef OBJCPLUS
error ("duplicate interface declaration for class %qs",
#else
- warning ("duplicate interface declaration for class %qs",
+ warning (0, "duplicate interface declaration for class %qs",
#endif
IDENTIFIER_POINTER (class_name));
else
}
else
{
- warning ("duplicate declaration for protocol %qs",
+ warning (0, "duplicate declaration for protocol %qs",
IDENTIFIER_POINTER (name));
}
return protocol;
warn_with_method (const char *message, int mtype, tree method)
{
/* Add a readable method name to the warning. */
- warning ("%J%s %<%c%s%>", method,
+ warning (0, "%J%s %<%c%s%>", method,
message, mtype, gen_method_decl (method));
}
/* A missing @end may not be detected by the parser. */
if (objc_implementation_context)
{
- warning ("%<@end%> missing in implementation context");
+ warning (0, "%<@end%> missing in implementation context");
finish_class (objc_implementation_context);
objc_ivar_chain = NULL_TREE;
objc_implementation_context = NULL_TREE;
if (TREE_CODE (objc_method_context) == INSTANCE_METHOD_DECL
&& other && other != error_mark_node && !DECL_FILE_SCOPE_P (other))
{
- warning ("local declaration of %qs hides instance variable",
+ warning (0, "local declaration of %qs hides instance variable",
IDENTIFIER_POINTER (id));
return other;
bad_lang = write_langs (lang_mask);
/* Eventually this should become a hard error IMO. */
- warning ("command line option \"%s\" is valid for %s but not for %s",
+ warning (0, "command line option \"%s\" is valid for %s but not for %s",
text, ok_langs, bad_lang);
free (ok_langs);
this to `2' if -Wall is used, so we can avoid giving out
lots of errors for people who don't realize what -Wall does. */
if (warn_uninitialized == 1)
- warning ("-Wuninitialized is not supported without -O");
+ warning (0, "-Wuninitialized is not supported without -O");
}
if (flag_really_no_inline == 2)
else if (!strcmp (arg, "local-exec"))
flag_tls_default = TLS_MODEL_LOCAL_EXEC;
else
- warning ("unknown tls-model \"%s\"", arg);
+ warning (0, "unknown tls-model \"%s\"", arg);
break;
case OPT_ftracer:
}
if (write_symbols == NO_DEBUG)
- warning ("target system does not support debug output");
+ warning (0, "target system does not support debug output");
}
}
else
&& flag_branch_target_load_optimize2
&& !warned)
{
- warning ("branch target register load optimization is not intended "
+ warning (0, "branch target register load optimization is not intended "
"to be run twice");
warned = 1;
}
else
{
- warning ("unknown register name: %s", name);
+ warning (0, "unknown register name: %s", name);
}
}
if (global_regs[i])
{
- warning ("register used for two global register variables");
+ warning (0, "register used for two global register variables");
return;
}
if (call_used_regs[i] && ! fixed_regs[i])
- warning ("call-clobbered register used for global register variable");
+ warning (0, "call-clobbered register used for global register variable");
global_regs[i] = 1;
if (size > STACK_CHECK_MAX_FRAME_SIZE)
{
- warning ("frame size too large for reliable stack checking");
+ warning (0, "frame size too large for reliable stack checking");
if (! verbose_warned)
{
- warning ("try reducing the number of local variables");
+ warning (0, "try reducing the number of local variables");
verbose_warned = 1;
}
}
size_t c_len = strlen (constraint);
if (p != constraint)
- warning ("output constraint %qc for operand %d "
+ warning (0, "output constraint %qc for operand %d "
"is not at the beginning",
*p, operand_num);
}
if (saw_match && !*allows_reg)
- warning ("matching constraint does not allow a register");
+ warning (0, "matching constraint does not allow a register");
return true;
}
if (allows_reg)
op = force_reg (TYPE_MODE (type), op);
else if (!allows_mem)
- warning ("asm operand %d probably doesn%'t match constraints",
+ warning (0, "asm operand %d probably doesn%'t match constraints",
i + noutputs);
else if (MEM_P (op))
{
}
else
{
- warning ("use of memory input without lvalue in "
+ warning (0, "use of memory input without lvalue in "
"asm operand %d is deprecated", i + noutputs);
if (CONSTANT_P (op))
if (TREE_SIDE_EFFECTS (exp))
return 0;
- warning ("%Hvalue computed is not used", &locus);
+ warning (0, "%Hvalue computed is not used", &locus);
return 1;
}
}
int size_as_int = TREE_INT_CST_LOW (size);
if (compare_tree_int (size, size_as_int) == 0)
- warning ("%Jsize of %qD is %d bytes", decl, decl, size_as_int);
+ warning (0, "%Jsize of %qD is %d bytes", decl, decl, size_as_int);
else
- warning ("%Jsize of %qD is larger than %d bytes",
+ warning (0, "%Jsize of %qD is larger than %d bytes",
decl, decl, larger_than_size);
}
}
if (TYPE_ALIGN (type) > desired_align)
{
if (STRICT_ALIGNMENT)
- warning ("%Jpacked attribute causes inefficient alignment "
+ warning (0, "%Jpacked attribute causes inefficient alignment "
"for %qD", field, field);
else
- warning ("%Jpacked attribute is unnecessary for %qD",
+ warning (0, "%Jpacked attribute is unnecessary for %qD",
field, field);
}
}
Bump the cumulative size to multiple of field alignment. */
if (warn_padded)
- warning ("%Jpadding struct to align %qD", field, field);
+ warning (0, "%Jpadding struct to align %qD", field, field);
/* If the alignment is still within offset_align, just align
the bit position. */
if (warn_padded && TREE_CONSTANT (unpadded_size)
&& simple_cst_equal (unpadded_size, TYPE_SIZE (rli->t)) == 0)
- warning ("padding struct size to alignment boundary");
+ warning (0, "padding struct size to alignment boundary");
if (warn_packed && TREE_CODE (rli->t) == RECORD_TYPE
&& TYPE_PACKED (rli->t) && ! rli->packed_maybe_necessary
name = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (rli->t)));
if (STRICT_ALIGNMENT)
- warning ("packed attribute causes inefficient "
+ warning (0, "packed attribute causes inefficient "
"alignment for %qs", name);
else
- warning ("packed attribute is unnecessary for %qs", name);
+ warning (0, "packed attribute is unnecessary for %qs", name);
}
else
{
if (STRICT_ALIGNMENT)
- warning ("packed attribute causes inefficient alignment");
+ warning (0, "packed attribute causes inefficient alignment");
else
- warning ("packed attribute is unnecessary");
+ warning (0, "packed attribute is unnecessary");
}
}
}
if (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
pedwarn ("%J%qF used but never defined", decl, decl);
else
- warning ("%J%qF declared %<static%> but never defined",
+ warning (0, "%J%qF declared %<static%> but never defined",
decl, decl);
/* This symbol is effectively an "extern" declaration now. */
TREE_PUBLIC (decl) = 1;
&& ! (TREE_CODE (decl) == VAR_DECL && DECL_REGISTER (decl))
/* Otherwise, ask the language. */
&& lang_hooks.decls.warn_unused_global (decl))
- warning ("%J%qD defined but not used", decl, decl);
+ warning (0, "%J%qD defined but not used", decl, decl);
/* Avoid confusing the debug information machinery when there are
errors. */
if (DECL_P (node))
{
expanded_location xloc = expand_location (DECL_SOURCE_LOCATION (node));
- warning ("%qs is deprecated (declared at %s:%d)",
+ warning (0, "%qs is deprecated (declared at %s:%d)",
IDENTIFIER_POINTER (DECL_NAME (node)),
xloc.file, xloc.line);
}
expanded_location xloc
= expand_location (DECL_SOURCE_LOCATION (decl));
if (what)
- warning ("%qs is deprecated (declared at %s:%d)", what,
+ warning (0, "%qs is deprecated (declared at %s:%d)", what,
xloc.file, xloc.line);
else
- warning ("type is deprecated (declared at %s:%d)",
+ warning (0, "type is deprecated (declared at %s:%d)",
xloc.file, xloc.line);
}
else
{
if (what)
- warning ("%qs is deprecated", what);
+ warning (0, "%qs is deprecated", what);
else
- warning ("type is deprecated");
+ warning (0, "type is deprecated");
}
}
}
case 'a':
default:
if (!enable_rtl_dump_file (c))
- warning ("unrecognized gcc debugging option: %c", c);
+ warning (0, "unrecognized gcc debugging option: %c", c);
break;
}
}
/* Warn about options that are not supported on this machine. */
#ifndef INSN_SCHEDULING
if (flag_schedule_insns || flag_schedule_insns_after_reload)
- warning ("instruction scheduling not supported on this target machine");
+ warning (0, "instruction scheduling not supported on this target machine");
#endif
#ifndef DELAY_SLOTS
if (flag_delayed_branch)
- warning ("this target machine does not have delayed branches");
+ warning (0, "this target machine does not have delayed branches");
#endif
user_label_prefix = USER_LABEL_PREFIX;
user_label_prefix = flag_leading_underscore ? "_" : "";
}
else
- warning ("-f%sleading-underscore not supported on this target machine",
+ warning (0, "-f%sleading-underscore not supported on this target machine",
flag_leading_underscore ? "" : "no-");
}
if (flag_var_tracking == 1)
{
if (debug_info_level < DINFO_LEVEL_NORMAL)
- warning ("variable tracking requested, but useless unless "
+ warning (0, "variable tracking requested, but useless unless "
"producing debug info");
else
- warning ("variable tracking requested, but not supported "
+ warning (0, "variable tracking requested, but not supported "
"by this debug format");
}
flag_var_tracking = 0;
{
if (flag_function_sections)
{
- warning ("-ffunction-sections not supported for this target");
+ warning (0, "-ffunction-sections not supported for this target");
flag_function_sections = 0;
}
if (flag_data_sections)
{
- warning ("-fdata-sections not supported for this target");
+ warning (0, "-fdata-sections not supported for this target");
flag_data_sections = 0;
}
}
if (flag_function_sections && profile_flag)
{
- warning ("-ffunction-sections disabled; it makes profiling impossible");
+ warning (0, "-ffunction-sections disabled; it makes profiling impossible");
flag_function_sections = 0;
}
#ifndef HAVE_prefetch
if (flag_prefetch_loop_arrays)
{
- warning ("-fprefetch-loop-arrays not supported for this target");
+ warning (0, "-fprefetch-loop-arrays not supported for this target");
flag_prefetch_loop_arrays = 0;
}
if (flag_speculative_prefetching)
{
if (flag_speculative_prefetching_set)
- warning ("-fspeculative-prefetching not supported for this target");
+ warning (0, "-fspeculative-prefetching not supported for this target");
flag_speculative_prefetching = 0;
}
#else
if (flag_prefetch_loop_arrays && !HAVE_prefetch)
{
- warning ("-fprefetch-loop-arrays not supported for this target (try -march switches)");
+ warning (0, "-fprefetch-loop-arrays not supported for this target (try -march switches)");
flag_prefetch_loop_arrays = 0;
}
if (flag_speculative_prefetching && !HAVE_prefetch)
{
if (flag_speculative_prefetching_set)
- warning ("-fspeculative-prefetching not supported for this target (try -march switches)");
+ warning (0, "-fspeculative-prefetching not supported for this target (try -march switches)");
flag_speculative_prefetching = 0;
}
#endif
make much sense anyway, so don't allow it. */
if (flag_prefetch_loop_arrays && optimize_size)
{
- warning ("-fprefetch-loop-arrays is not supported with -Os");
+ warning (0, "-fprefetch-loop-arrays is not supported with -Os");
flag_prefetch_loop_arrays = 0;
}
#ifndef OBJECT_FORMAT_ELF
if (flag_function_sections && write_symbols != NO_DEBUG)
- warning ("-ffunction-sections may affect debugging on some targets");
+ warning (0, "-ffunction-sections may affect debugging on some targets");
#endif
/* The presence of IEEE signaling NaNs, implies all math can trap. */
#endif
extern void internal_error (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2)
ATTRIBUTE_NORETURN;
-extern void warning (const char *, ...) ATTRIBUTE_GCC_FE_DIAG(1,2);
+extern void warning0 (const char *, ...) ATTRIBUTE_GCC_FE_DIAG(1,2);
+extern void warning (int, const char *, ...) ATTRIBUTE_GCC_FE_DIAG(2,3);
extern void error (const char *, ...) ATTRIBUTE_GCC_FE_DIAG(1,2);
extern void fatal_error (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2)
ATTRIBUTE_NORETURN;
location_t loc = EXPR_LOCATION (stmt);
if (LOCATION_LINE (loc) > 0)
{
- warning ("%Hwill never be executed", &loc);
+ warning (0, "%Hwill never be executed", &loc);
return true;
}
}
in the block. */
#ifdef USE_MAPPED_LOCATION
if (warn_notreached && loc > BUILTINS_LOCATION)
- warning ("%Hwill never be executed", &loc);
+ warning (0, "%Hwill never be executed", &loc);
#else
if (warn_notreached && loc)
- warning ("%Hwill never be executed", loc);
+ warning (0, "%Hwill never be executed", loc);
#endif
remove_phi_nodes_and_edges_for_unreachable_block (bb);
&& !TREE_THIS_VOLATILE (cfun->decl)
&& EDGE_COUNT (EXIT_BLOCK_PTR->preds) == 0
&& !lang_hooks.function.missing_noreturn_ok_p (cfun->decl))
- warning ("%Jfunction might be possible candidate for "
+ warning (0, "%Jfunction might be possible candidate for "
"attribute %<noreturn%>",
cfun->decl);
#ifdef USE_MAPPED_LOCATION
if (location == UNKNOWN_LOCATION)
location = cfun->function_end_locus;
- warning ("%H%<noreturn%> function does return", &location);
+ warning (0, "%H%<noreturn%> function does return", &location);
#else
if (!locus)
locus = &cfun->function_end_locus;
- warning ("%H%<noreturn%> function does return", locus);
+ warning (0, "%H%<noreturn%> function does return", locus);
#endif
}
location = EXPR_LOCATION (last);
if (location == UNKNOWN_LOCATION)
location = cfun->function_end_locus;
- warning ("%Hcontrol reaches end of non-void function", &location);
+ warning (0, "%Hcontrol reaches end of non-void function", &location);
#else
locus = EXPR_LOCUS (last);
if (!locus)
locus = &cfun->function_end_locus;
- warning ("%Hcontrol reaches end of non-void function", locus);
+ warning (0, "%Hcontrol reaches end of non-void function", locus);
#endif
TREE_NO_WARNING (cfun->decl) = 1;
break;
flags |= option_ptr->value;
goto found;
}
- warning ("ignoring unknown option %q.*s in %<-fdump-%s%>",
+ warning (0, "ignoring unknown option %q.*s in %<-fdump-%s%>",
length, ptr, dfi->swtch);
found:;
ptr = end_ptr;
if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)))
sorry (inline_forbidden_reason, fn, fn);
else if (do_warning)
- warning (inline_forbidden_reason, fn, fn);
+ warning (0, inline_forbidden_reason, fn, fn);
inlinable = false;
}
&& strlen (reason)
&& !lookup_attribute ("noinline", DECL_ATTRIBUTES (fn)))
{
- warning ("%Jinlining failed in call to %qF: %s", fn, fn, reason);
- warning ("called from here");
+ warning (0, "%Jinlining failed in call to %qF: %s", fn, fn, reason);
+ warning (0, "called from here");
}
goto egress;
}
&& return_slot_addr == NULL_TREE
&& block_may_fallthru (copy))
{
- warning ("control may reach end of non-void function %qD being inlined",
+ warning (0, "control may reach end of non-void function %qD being inlined",
fn);
TREE_NO_WARNING (fn) = 1;
}
break;
case ARRAY_RANGE_REF:
- warning ("mudflap checking not yet implemented for ARRAY_RANGE_REF");
+ warning (0, "mudflap checking not yet implemented for ARRAY_RANGE_REF");
return;
case BIT_FIELD_REF:
/* Add the __mf_register call at the current appending point. */
if (tsi_end_p (initially_stmts))
- warning ("mudflap cannot track %qs in stub function",
+ warning (0, "mudflap cannot track %qs in stub function",
IDENTIFIER_POINTER (DECL_NAME (decl)));
else
{
if (! COMPLETE_TYPE_P (TREE_TYPE (obj)))
{
- warning ("mudflap cannot track unknown size extern %qs",
+ warning (0, "mudflap cannot track unknown size extern %qs",
IDENTIFIER_POINTER (DECL_NAME (obj)));
continue;
}
= TREE_INT_CST_LOW (TYPE_SIZE_UNIT (ret_type));
if (compare_tree_int (TYPE_SIZE_UNIT (ret_type), size_as_int) == 0)
- warning ("%Jsize of return value of %qD is %u bytes",
+ warning (0, "%Jsize of return value of %qD is %u bytes",
fndecl, fndecl, size_as_int);
else
- warning ("%Jsize of return value of %qD is larger than %wd bytes",
+ warning (0, "%Jsize of return value of %qD is larger than %wd bytes",
fndecl, fndecl, larger_than_size);
}
}
locus = (context != NULL && EXPR_HAS_LOCATION (context)
? EXPR_LOCUS (context)
: &DECL_SOURCE_LOCATION (var));
- warning (msgid, locus, var);
+ warning (0, msgid, locus, var);
TREE_NO_WARNING (var) = 1;
}
}
if (TREE_CODE (node) != RECORD_TYPE && TREE_CODE (node) != UNION_TYPE)
{
- warning ("%qs attribute ignored", IDENTIFIER_POINTER (name));
+ warning (0, "%qs attribute ignored", IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
+2005-04-23 DJ Delorie <dj@redhat.com>
+
+ * parse.y: Adjust warning() callers.
+
2005-04-11 Richard Sandiford <rsandifo@redhat.com>
* lang.opt: Refer to the GCC internals documentation instead of c.opt.
tree_code_generate_return (type_prod->tp.pro.code, NULL);
else
{
- warning ("%HRedundant expression in return.",
+ warning (0, "%HRedundant expression in return.",
&ret_tok->tp.tok.location, ret_tok->tp.tok.length,
ret_tok->tp.tok.chars);
tree_code_generate_return (type_prod->tp.pro.code, NULL);
error ("global register variable has initial value");
}
if (TREE_THIS_VOLATILE (decl))
- warning ("volatile register variables don%'t "
+ warning (0, "volatile register variables don%'t "
"work as you might wish");
/* If the user specified one of the eliminables registers here,
In particular, a.out format supports a maximum alignment of 4. */
if (align > MAX_OFILE_ALIGNMENT)
{
- warning ("%Jalignment of %qD is greater than maximum object "
+ warning (0, "%Jalignment of %qD is greater than maximum object "
"file alignment. Using %d", decl, decl,
MAX_OFILE_ALIGNMENT/BITS_PER_UNIT);
align = MAX_OFILE_ALIGNMENT;
#if !defined(ASM_OUTPUT_ALIGNED_COMMON) && !defined(ASM_OUTPUT_ALIGNED_DECL_COMMON) && !defined(ASM_OUTPUT_ALIGNED_BSS)
if ((unsigned HOST_WIDE_INT) DECL_ALIGN_UNIT (decl) > rounded)
- warning ("%Jrequested alignment for %qD is greater than "
+ warning (0, "%Jrequested alignment for %qD is greater than "
"implemented alignment of %d", decl, decl, rounded);
#endif
a weak symbol. */
else if (TREE_USED (olddecl)
&& TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (olddecl)))
- warning ("%Jweak declaration of %qD after first use results "
+ warning (0, "%Jweak declaration of %qD after first use results "
"in unspecified behavior", newdecl, newdecl);
if (SUPPORTS_WEAK)
weak_decls = tree_cons (NULL, decl, weak_decls);
}
else
- warning ("%Jweak declaration of %qD not supported", decl, decl);
+ warning (0, "%Jweak declaration of %qD not supported", decl, decl);
mark_weak (decl);
}
ASM_WEAKEN_LABEL (asm_out_file, name);
#else
#ifdef ASM_OUTPUT_WEAK_ALIAS
- warning ("only weak aliases are supported in this configuration");
+ warning (0, "only weak aliases are supported in this configuration");
return;
#endif
#endif
assemble_name (asm_out_file, name);
fprintf (asm_out_file, "\n");
#else
- warning ("visibility attribute not supported in this configuration; ignored");
+ warning (0, "visibility attribute not supported in this configuration; ignored");
#endif
}