aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorManuel López-Ibáñez <manu@gcc.gnu.org>2009-07-07 02:55:59 +0000
committerManuel López-Ibáñez <manu@gcc.gnu.org>2009-07-07 02:55:59 +0000
commitc5d753640d06e51da60056f0ee354b5134cad1f7 (patch)
treed34263b5ff9f1576a23b9f95e545dc831212bc84 /gcc/c-decl.c
parentb932c20b25c7516eb5fa2a813b8bfa786569c0b4 (diff)
downloadgcc-c5d753640d06e51da60056f0ee354b5134cad1f7.zip
gcc-c5d753640d06e51da60056f0ee354b5134cad1f7.tar.gz
gcc-c5d753640d06e51da60056f0ee354b5134cad1f7.tar.bz2
cgraphunit.c: Replace %J by an explicit location.
2009-07-07 Manuel López-Ibáñez <manu@gcc.gnu.org> * cgraphunit.c: Replace %J by an explicit location. Update all calls. * c-decl.c: Likewise. * function.c: Likewise. * varasm.c: Likewise. * tree-ssa.c: Likewise. * c-common.c: Likewise. * tree-cfg.c: Likewise. * config/spu/spu.c: Likewise. * config/ia64/ia64.c: Likewise. * config/v850/v850.c: Likewise. java/ * class.c: Replace %J by an explicit location. Update all calls. objc/ * objc-act.c: Replace %J by an explicit location. Update all calls. cp/ * init.c: Replace %J by an explicit location. Update all calls. * decl.c: Likewise. * typeck2.c: Likewise. * pt.c: Likewise. * name-lookup.c: Likewise. From-SVN: r149312
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c55
1 files changed, 30 insertions, 25 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index fdceb20..fa578cb 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -1890,9 +1890,10 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
DECL_ATTRIBUTES (olddecl)) != NULL;
if (newa != olda)
{
- error ("%<gnu_inline%> attribute present on %q+D",
- newa ? newdecl : olddecl);
- error ("%Jbut not here", newa ? olddecl : newdecl);
+ error_at (input_location, "%<gnu_inline%> attribute present on %q+D",
+ newa ? newdecl : olddecl);
+ error_at (DECL_SOURCE_LOCATION (newa ? olddecl : newdecl),
+ "but not here");
}
}
}
@@ -2489,7 +2490,8 @@ warn_if_shadowing (tree new_decl)
warning (OPT_Wshadow, "declaration of %q+D shadows a previous local",
new_decl);
- warning (OPT_Wshadow, "%Jshadowed declaration is here", old_decl);
+ warning_at (DECL_SOURCE_LOCATION (old_decl), OPT_Wshadow,
+ "shadowed declaration is here");
break;
}
@@ -6002,11 +6004,13 @@ grokparms (struct c_arg_info *arg_info, bool funcdef_flag)
if (funcdef_flag)
{
if (DECL_NAME (parm))
- error ("parameter %u (%q+D) has incomplete type",
- parmno, parm);
+ error_at (input_location,
+ "parameter %u (%q+D) has incomplete type",
+ parmno, parm);
else
- error ("%Jparameter %u has incomplete type",
- parm, parmno);
+ error_at (DECL_SOURCE_LOCATION (parm),
+ "parameter %u has incomplete type",
+ parmno);
TREE_VALUE (typelt) = error_mark_node;
TREE_TYPE (parm) = error_mark_node;
@@ -6014,11 +6018,13 @@ grokparms (struct c_arg_info *arg_info, bool funcdef_flag)
else if (VOID_TYPE_P (type))
{
if (DECL_NAME (parm))
- warning (0, "parameter %u (%q+D) has void type",
- parmno, parm);
+ warning_at (input_location, 0,
+ "parameter %u (%q+D) has void type",
+ parmno, parm);
else
- warning (0, "%Jparameter %u has void type",
- parm, parmno);
+ warning_at (DECL_SOURCE_LOCATION (parm), 0,
+ "parameter %u has void type",
+ parmno);
}
}
@@ -6722,28 +6728,27 @@ finish_struct (location_t loc, tree t, tree fieldlist, tree attributes,
if (TREE_CODE (t) == UNION_TYPE)
{
error_at (DECL_SOURCE_LOCATION (x),
- "%Jflexible array member in union", x);
+ "flexible array member in union");
TREE_TYPE (x) = error_mark_node;
}
else if (TREE_CHAIN (x) != NULL_TREE)
{
error_at (DECL_SOURCE_LOCATION (x),
- "%Jflexible array member not at end of struct", x);
+ "flexible array member not at end of struct");
TREE_TYPE (x) = error_mark_node;
}
else if (!saw_named_field)
{
error_at (DECL_SOURCE_LOCATION (x),
- "%Jflexible array member in otherwise empty struct",
- x);
+ "flexible array member in otherwise empty struct");
TREE_TYPE (x) = error_mark_node;
}
}
- if (pedantic && !in_system_header && TREE_CODE (t) == RECORD_TYPE
+ if (pedantic && TREE_CODE (t) == RECORD_TYPE
&& flexible_array_type_p (TREE_TYPE (x)))
- pedwarn (loc, OPT_pedantic,
- "%Jinvalid use of structure with flexible array member", x);
+ pedwarn (DECL_SOURCE_LOCATION (x), OPT_pedantic,
+ "invalid use of structure with flexible array member");
if (DECL_NAME (x))
saw_named_field = 1;
@@ -7465,8 +7470,9 @@ store_parm_decls_newstyle (tree fndecl, const struct c_arg_info *arg_info)
if (current_scope->bindings)
{
- error ("%Jold-style parameter declarations in prototyped "
- "function definition", fndecl);
+ error_at (DECL_SOURCE_LOCATION (fndecl),
+ "old-style parameter declarations in prototyped "
+ "function definition");
/* Get rid of the old-style declarations. */
pop_scope ();
@@ -7478,9 +7484,8 @@ store_parm_decls_newstyle (tree fndecl, const struct c_arg_info *arg_info)
its parameter list). */
else if (!in_system_header && !current_function_scope
&& arg_info->types != error_mark_node)
- warning (OPT_Wtraditional,
- "%Jtraditional C rejects ISO C style function definitions",
- fndecl);
+ warning_at (DECL_SOURCE_LOCATION (fndecl), OPT_Wtraditional,
+ "traditional C rejects ISO C style function definitions");
/* Now make all the parameter declarations visible in the function body.
We can bypass most of the grunt work of pushdecl. */
@@ -7496,7 +7501,7 @@ store_parm_decls_newstyle (tree fndecl, const struct c_arg_info *arg_info)
warn_if_shadowing (decl);
}
else
- error ("%Jparameter name omitted", decl);
+ error_at (DECL_SOURCE_LOCATION (decl), "parameter name omitted");
}
/* Record the parameter list in the function declaration. */