&& TREE_PUBLIC (p)
&& !DECL_INITIAL (p)
&& !flag_gnu89_inline)
- pedwarn (0, "inline function %q+D declared but never defined", p);
+ pedwarn (input_location, 0, "inline function %q+D declared but never defined", p);
goto common_symbol;
&& TYPE_MAIN_VARIANT (TREE_TYPE (newtype)) == integer_type_node
&& C_FUNCTION_IMPLICIT_INT (newdecl) && !DECL_INITIAL (olddecl))
{
- pedwarned = pedwarn (0, "conflicting types for %q+D", newdecl);
+ pedwarned = pedwarn (input_location, 0,
+ "conflicting types for %q+D", newdecl);
/* Make sure we keep void as the return type. */
TREE_TYPE (newdecl) = *newtypep = newtype = oldtype;
C_FUNCTION_IMPLICIT_INT (newdecl) = 0;
&& TYPE_MAIN_VARIANT (TREE_TYPE (oldtype)) == integer_type_node
&& C_DECL_IMPLICIT (olddecl) && !DECL_INITIAL (olddecl))
{
- pedwarned = pedwarn (0, "conflicting types for %q+D", newdecl);
+ pedwarned = pedwarn (input_location, 0,
+ "conflicting types for %q+D", newdecl);
/* Make sure we keep void as the return type. */
TREE_TYPE (olddecl) = *oldtypep = oldtype = newtype;
}
bool warned;
if (flag_isoc99)
- warned = pedwarn (OPT_Wimplicit_function_declaration,
- G_("implicit declaration of function %qE"), id);
+ warned = pedwarn (input_location, OPT_Wimplicit_function_declaration,
+ "implicit declaration of function %qE", id);
else
warned = warning (OPT_Wimplicit_function_declaration,
G_("implicit declaration of function %qE"), id);
if (warned != 1 && code != ENUMERAL_TYPE)
/* Empty unnamed enum OK */
{
- pedwarn (0, "unnamed struct/union that defines no instances");
+ pedwarn (input_location, 0,
+ "unnamed struct/union that defines no instances");
warned = 1;
}
}
&& declspecs->storage_class != csc_none)
{
if (warned != 1)
- pedwarn (0, "empty declaration with storage class specifier "
- "does not redeclare tag");
+ pedwarn (input_location, 0,
+ "empty declaration with storage class specifier "
+ "does not redeclare tag");
warned = 1;
pending_xref_error ();
}
|| declspecs->restrict_p))
{
if (warned != 1)
- pedwarn (0, "empty declaration with type qualifier "
+ pedwarn (input_location, 0,
+ "empty declaration with type qualifier "
"does not redeclare tag");
warned = 1;
pending_xref_error ();
{
if (warned != 1 && !in_system_header)
{
- pedwarn (0, "useless type name in empty declaration");
+ pedwarn (input_location, 0,
+ "useless type name in empty declaration");
warned = 1;
}
}
}
else if (warned != 1 && !in_system_header && declspecs->typedef_p)
{
- pedwarn (0, "useless type name in empty declaration");
+ pedwarn (input_location, 0, "useless type name in empty declaration");
warned = 1;
}
if (warned != 1)
{
if (!found_tag)
- pedwarn (0, "empty declaration");
+ pedwarn (input_location, 0, "empty declaration");
}
}
\f
if (!flag_isoc99)
{
if (static_p || quals != NULL)
- pedwarn (OPT_pedantic, "ISO C90 does not support %<static%> or type "
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C90 does not support %<static%> or type "
"qualifiers in parameter array declarators");
if (vla_unspec_p)
- pedwarn (OPT_pedantic, "ISO C90 does not support %<[*]%> array declarators");
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C90 does not support %<[*]%> array declarators");
}
if (vla_unspec_p)
{
&& !TREE_READONLY (decl)
&& DECL_DECLARED_INLINE_P (current_function_decl)
&& DECL_EXTERNAL (current_function_decl))
- pedwarn (0, "%q+D is static but declared in inline function %qD "
- "which is not static", decl, current_function_decl);
+ pedwarn (input_location, 0,
+ "%q+D is static but declared in inline function %qD "
+ "which is not static", decl, current_function_decl);
/* Add this decl to the current scope.
TEM may equal DECL or it may be a previous decl of the same name. */
if (pedantic && !current_scope->warned_forward_parm_decls)
{
- pedwarn (OPT_pedantic, "ISO C forbids forward parameter declarations");
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C forbids forward parameter declarations");
current_scope->warned_forward_parm_decls = true;
}
&& type_mv != integer_type_node
&& type_mv != unsigned_type_node
&& type_mv != boolean_type_node)
- pedwarn (OPT_pedantic, "type of bit-field %qs is a GCC extension", name);
+ pedwarn (input_location, OPT_pedantic,
+ "type of bit-field %qs is a GCC extension", name);
max_width = TYPE_PRECISION (*type);
if (const_size)
{
if (name)
- pedwarn (OPT_Wvla, "ISO C90 forbids array %qs whose size "
+ pedwarn (input_location, OPT_Wvla, "ISO C90 forbids array %qs whose size "
"can%'t be evaluated",
name);
else
- pedwarn (OPT_Wvla, "ISO C90 forbids array whose size "
+ pedwarn (input_location, OPT_Wvla, "ISO C90 forbids array whose size "
"can%'t be evaluated");
}
else
{
if (name)
- pedwarn (OPT_Wvla, "ISO C90 forbids variable length array %qs",
+ pedwarn (input_location, OPT_Wvla, "ISO C90 forbids variable length array %qs",
name);
else
- pedwarn (OPT_Wvla, "ISO C90 forbids variable length array");
+ pedwarn (input_location, OPT_Wvla, "ISO C90 forbids variable length array");
}
}
else if (warn_vla > 0)
&& funcdef_flag)
warn_about_return_type = 1;
else
- pedwarn_c99 (flag_isoc99 ? 0 : OPT_Wimplicit_int,
+ pedwarn_c99 (input_location, flag_isoc99 ? 0 : OPT_Wimplicit_int,
"type defaults to %<int%> in declaration of %qs", name);
}
if (pedantic && !flag_isoc99)
{
if (constp > 1)
- pedwarn (OPT_pedantic, "duplicate %<const%>");
+ pedwarn (input_location, OPT_pedantic, "duplicate %<const%>");
if (restrictp > 1)
- pedwarn (OPT_pedantic, "duplicate %<restrict%>");
+ pedwarn (input_location, OPT_pedantic, "duplicate %<restrict%>");
if (volatilep > 1)
- pedwarn (OPT_pedantic, "duplicate %<volatile%>");
+ pedwarn (input_location, OPT_pedantic, "duplicate %<volatile%>");
}
if (!flag_gen_aux_info && (TYPE_QUALS (element_type)))
type = TYPE_MAIN_VARIANT (type);
|| storage_class == csc_typedef))
{
if (storage_class == csc_auto)
- pedwarn ((current_scope == file_scope) ? 0 : OPT_pedantic,
+ pedwarn (input_location,
+ (current_scope == file_scope) ? 0 : OPT_pedantic,
"function definition declared %<auto%>");
if (storage_class == csc_register)
error ("function definition declared %<register%>");
if (storage_class == csc_auto)
error ("file-scope declaration of %qs specifies %<auto%>", name);
if (pedantic && storage_class == csc_register)
- pedwarn (OPT_pedantic, "file-scope declaration of %qs specifies %<register%>", name);
+ pedwarn (input_location, OPT_pedantic,
+ "file-scope declaration of %qs specifies %<register%>", name);
}
else
{
}
if (pedantic && !in_system_header && flexible_array_type_p (type))
- pedwarn (OPT_pedantic, "invalid use of structure with flexible array member");
+ pedwarn (input_location, OPT_pedantic,
+ "invalid use of structure with flexible array member");
if (size == error_mark_node)
type = error_mark_node;
}
if (pedantic && integer_zerop (size))
- pedwarn (OPT_pedantic, "ISO C forbids zero-size array %qs", name);
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C forbids zero-size array %qs", name);
if (TREE_CODE (size) == INTEGER_CST)
{
else if (decl_context == FIELD)
{
if (pedantic && !flag_isoc99 && !in_system_header)
- pedwarn (OPT_pedantic, "ISO C90 does not support flexible array members");
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C90 does not support flexible array members");
/* ISO C99 Flexible array members are effectively
identical to GCC's zero-length array extension. */
function definitions in ISO C; GCC used to used
them for noreturn functions. */
if (VOID_TYPE_P (type) && really_funcdef)
- pedwarn (0, "function definition has qualified void return type");
+ pedwarn (input_location, 0,
+ "function definition has qualified void return type");
else
warning (OPT_Wignored_qualifiers,
"type qualifiers ignored on function return type");
if (pedantic && TREE_CODE (type) == FUNCTION_TYPE
&& type_quals)
- pedwarn (OPT_pedantic, "ISO C forbids qualified function types");
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C forbids qualified function types");
if (type_quals)
type = c_build_qualified_type (type, type_quals);
size_varies = 0;
tree decl;
if (pedantic && TREE_CODE (type) == FUNCTION_TYPE
&& type_quals)
- pedwarn (OPT_pedantic, "ISO C forbids qualified function types");
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C forbids qualified function types");
if (type_quals)
type = c_build_qualified_type (type, type_quals);
decl = build_decl (TYPE_DECL, declarator->u.id, type);
if (declspecs->explicit_signed_p)
C_TYPEDEF_EXPLICITLY_SIGNED (decl) = 1;
if (declspecs->inline_p)
- pedwarn (0, "typedef %q+D declared %<inline%>", decl);
+ pedwarn (input_location, 0,"typedef %q+D declared %<inline%>", decl);
return decl;
}
&& !declspecs->inline_p);
if (pedantic && TREE_CODE (type) == FUNCTION_TYPE
&& type_quals)
- pedwarn (OPT_pedantic, "ISO C forbids const or volatile function types");
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C forbids const or volatile function types");
if (type_quals)
type = c_build_qualified_type (type, type_quals);
return type;
&& variably_modified_type_p (type, NULL_TREE))
{
/* C99 6.7.2.1p8 */
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"a member of a structure or union cannot have a variably modified type");
}
else if (TREE_CODE (type) == FUNCTION_TYPE)
{
if (type_quals)
- pedwarn (OPT_pedantic, "ISO C forbids qualified function types");
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C forbids qualified function types");
if (type_quals)
type = c_build_qualified_type (type, type_quals);
type = build_pointer_type (type);
DECL_ARG_TYPE (decl) = promoted_type;
if (declspecs->inline_p)
- pedwarn (0, "parameter %q+D declared %<inline%>", decl);
+ pedwarn (input_location, 0, "parameter %q+D declared %<inline%>", decl);
}
else if (decl_context == FIELD)
{
GCC allows 'auto', perhaps with 'inline', to support
nested functions. */
if (storage_class == csc_auto)
- pedwarn (OPT_pedantic, "invalid storage class for function %qs", name);
+ pedwarn (input_location, OPT_pedantic, "invalid storage class for function %qs", name);
else if (storage_class == csc_static)
{
error ("invalid storage class for function %qs", name);
decl = build_decl_attribute_variant (decl, decl_attr);
if (pedantic && type_quals && !DECL_IN_SYSTEM_HEADER (decl))
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"ISO C forbids qualified function types");
/* GNU C interprets a volatile-qualified function type to indicate
if (flag_hosted && MAIN_NAME_P (declarator->u.id))
{
if (declspecs->inline_p)
- pedwarn (0, "cannot inline function %<main%>");
+ pedwarn (input_location, 0, "cannot inline function %<main%>");
}
else if (declspecs->inline_p)
/* Record that the function is declared `inline'. */
C_DECL_VARIABLE_SIZE (decl) = 1;
if (declspecs->inline_p)
- pedwarn (0, "variable %q+D declared %<inline%>", decl);
+ pedwarn (input_location, 0, "variable %q+D declared %<inline%>", decl);
/* At file scope, an initialized extern declaration may follow
a static declaration. In that case, DECL_EXTERNAL will be
else if (arg_types && TREE_CODE (TREE_VALUE (arg_types)) == IDENTIFIER_NODE)
{
if (!funcdef_flag)
- pedwarn (0, "parameter names (without types) in function declaration");
+ pedwarn (input_location, 0, "parameter names (without types) in function declaration");
arg_info->parms = arg_info->types;
arg_info->types = 0;
}
if (!ok)
{
- pedwarn (0, "declaration does not declare anything");
+ pedwarn (input_location, 0, "declaration does not declare anything");
return NULL_TREE;
}
- pedwarn (OPT_pedantic, "ISO C doesn%'t support unnamed structs/unions");
+ pedwarn (input_location, OPT_pedantic, "ISO C doesn%'t support unnamed structs/unions");
}
value = grokdeclarator (declarator, declspecs, FIELD, false,
if (TREE_CODE (t) == UNION_TYPE)
{
if (fieldlist)
- pedwarn (OPT_pedantic, "union has no named members");
+ pedwarn (input_location, OPT_pedantic, "union has no named members");
else
- pedwarn (OPT_pedantic, "union has no members");
+ pedwarn (input_location, OPT_pedantic, "union has no members");
}
else
{
if (fieldlist)
- pedwarn (OPT_pedantic, "struct has no named members");
+ pedwarn (input_location, OPT_pedantic, "struct has no named members");
else
- pedwarn (OPT_pedantic, "struct has no members");
+ pedwarn (input_location, OPT_pedantic, "struct has no members");
}
}
}
if (pedantic && !in_system_header && TREE_CODE (t) == RECORD_TYPE
&& flexible_array_type_p (TREE_TYPE (x)))
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"%Jinvalid use of structure with flexible array member", x);
if (DECL_NAME (x))
(6.4.4.3/2 in the C99 Standard). GCC allows any integer type as
an extension. */
else if (!int_fits_type_p (value, integer_type_node))
- pedwarn_at (value_loc, OPT_pedantic,
- "ISO C restricts enumerator values to range of %<int%>");
+ pedwarn (value_loc, OPT_pedantic,
+ "ISO C restricts enumerator values to range of %<int%>");
/* Set basis for default for next value. */
the_enum->enum_next_value = build_binary_op (PLUS_EXPR, value,
}
if (warn_about_return_type)
- pedwarn_c99 (flag_isoc99 ? 0
+ pedwarn_c99 (input_location, flag_isoc99 ? 0
: (warn_return_type ? OPT_Wreturn_type : OPT_Wimplicit_int),
"return type defaults to %<int%>");
{
if (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (decl1)))
!= integer_type_node)
- pedwarn (OPT_Wmain, "return type of %q+D is not %<int%>", decl1);
+ pedwarn (input_location, OPT_Wmain, "return type of %q+D is not %<int%>", decl1);
check_main_parameter_types (decl1);
if (!TREE_PUBLIC (decl1))
- pedwarn (OPT_Wmain, "%q+D is normally a non-static function", decl1);
+ pedwarn (input_location, OPT_Wmain, "%q+D is normally a non-static function", decl1);
}
/* Record the decl so that the function name is defined.
warn_if_shadowing (decl);
if (flag_isoc99)
- pedwarn (0, "type of %q+D defaults to %<int%>", decl);
+ pedwarn (input_location, 0, "type of %q+D defaults to %<int%>", decl);
else
warning (OPT_Wmissing_parameter_type, "type of %q+D defaults to %<int%>", decl);
}
"doesn%'t match built-in prototype", parm);
else
{
- pedwarn (OPT_pedantic, "promoted argument %qD "
+ pedwarn (input_location, OPT_pedantic, "promoted argument %qD "
"doesn%'t match prototype", parm);
- pedwarn (OPT_pedantic, "%Hprototype declaration",
- ¤t_function_prototype_locus);
+ pedwarn (current_function_prototype_locus, OPT_pedantic,
+ "prototype declaration");
}
}
else
gcc_unreachable ();
}
if (dupe && !flag_isoc99)
- pedwarn (OPT_pedantic, "duplicate %qE", qual);
+ pedwarn (input_location, OPT_pedantic, "duplicate %qE", qual);
return specs;
}
break;
}
if (pedantic && !flag_isoc99 && !in_system_header)
- pedwarn (OPT_Wlong_long, "ISO C90 does not support %<long long%>");
+ pedwarn (input_location, OPT_Wlong_long, "ISO C90 does not support %<long long%>");
specs->long_long_p = 1;
break;
}
case RID_COMPLEX:
dupe = specs->complex_p;
if (!flag_isoc99 && !in_system_header)
- pedwarn (OPT_pedantic, "ISO C90 does not support complex types");
+ pedwarn (input_location, OPT_pedantic, "ISO C90 does not support complex types");
if (specs->typespec_word == cts_void)
error ("both %<complex%> and %<void%> in "
"declaration specifiers");
break;
case RID_SAT:
dupe = specs->saturating_p;
- pedwarn (OPT_pedantic, "ISO C does not support saturating types");
+ pedwarn (input_location, OPT_pedantic, "ISO C does not support saturating types");
if (specs->typespec_word == cts_void)
error ("both %<_Sat%> and %<void%> in "
"declaration specifiers");
}
if (!targetm.decimal_float_supported_p ())
error ("decimal floating point not supported for this target");
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"ISO C does not support decimal floating point");
return specs;
case RID_FRACT:
}
if (!targetm.fixed_point_supported_p ())
error ("fixed-point types not supported for this target");
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"ISO C does not support fixed-point types");
return specs;
default:
else if (specs->complex_p)
{
specs->typespec_word = cts_double;
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"ISO C does not support plain %<complex%> meaning "
"%<double complex%>");
}
specs->type = char_type_node;
if (specs->complex_p)
{
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"ISO C does not support complex integer types");
specs->type = build_complex_type (specs->type);
}
: integer_type_node);
if (specs->complex_p)
{
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"ISO C does not support complex integer types");
specs->type = build_complex_type (specs->type);
}
&& !TREE_PUBLIC (decl)
&& C_DECL_USED (decl))
{
- pedwarn (0, "%q+F used but never defined", decl);
+ pedwarn (input_location, 0, "%q+F used but never defined", decl);
TREE_NO_WARNING (decl) = 1;
}