summaryrefslogtreecommitdiffstats
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authormanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-07 02:55:59 +0000
committermanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-07 02:55:59 +0000
commit712d22976c2f8c0053865790f0e0674337864ab9 (patch)
treed34263b5ff9f1576a23b9f95e545dc831212bc84 /gcc/c-common.c
parent975b43967f9e784e01aaf52860786c2a3cb85a28 (diff)
downloadppe42-gcc-712d22976c2f8c0053865790f0e0674337864ab9.tar.gz
ppe42-gcc-712d22976c2f8c0053865790f0e0674337864ab9.zip
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149312 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c38
1 files changed, 23 insertions, 15 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 772d9687bf8..1c883d15308 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -5417,13 +5417,15 @@ match_case_to_enum_1 (tree key, tree type, tree label)
(unsigned HOST_WIDE_INT) TREE_INT_CST_LOW (key));
if (TYPE_NAME (type) == 0)
- warning (warn_switch ? OPT_Wswitch : OPT_Wswitch_enum,
- "%Jcase value %qs not in enumerated type",
- CASE_LABEL (label), buf);
+ warning_at (DECL_SOURCE_LOCATION (CASE_LABEL (label)),
+ warn_switch ? OPT_Wswitch : OPT_Wswitch_enum,
+ "case value %qs not in enumerated type",
+ buf);
else
- warning (warn_switch ? OPT_Wswitch : OPT_Wswitch_enum,
- "%Jcase value %qs not in enumerated type %qT",
- CASE_LABEL (label), buf, type);
+ warning_at (DECL_SOURCE_LOCATION (CASE_LABEL (label)),
+ warn_switch ? OPT_Wswitch : OPT_Wswitch_enum,
+ "case value %qs not in enumerated type %qT",
+ buf, type);
}
/* Subroutine of c_do_switch_warnings, called via splay_tree_foreach.
@@ -6493,8 +6495,9 @@ handle_section_attribute (tree *node, tree ARG_UNUSED (name), tree args,
&& current_function_decl != NULL_TREE
&& !TREE_STATIC (decl))
{
- error ("%Jsection attribute cannot be specified for "
- "local variables", decl);
+ error_at (DECL_SOURCE_LOCATION (decl),
+ "section attribute cannot be specified for "
+ "local variables");
*no_add_attrs = true;
}
@@ -6526,7 +6529,8 @@ handle_section_attribute (tree *node, tree ARG_UNUSED (name), tree args,
}
else
{
- error ("%Jsection attributes are not supported for this target", *node);
+ error_at (DECL_SOURCE_LOCATION (*node),
+ "section attributes are not supported for this target");
*no_add_attrs = true;
}
@@ -6745,8 +6749,8 @@ handle_weakref_attribute (tree *node, tree ARG_UNUSED (name), tree args,
else
{
if (lookup_attribute ("alias", DECL_ATTRIBUTES (*node)))
- error ("%Jweakref attribute must appear before alias attribute",
- *node);
+ error_at (DECL_SOURCE_LOCATION (*node),
+ "weakref attribute must appear before alias attribute");
/* Can't call declare_weak because it wants this to be TREE_PUBLIC,
and that isn't supported; and because it wants to add it to
@@ -6956,12 +6960,14 @@ handle_no_instrument_function_attribute (tree *node, tree name,
if (TREE_CODE (decl) != FUNCTION_DECL)
{
- error ("%J%qE attribute applies only to functions", decl, name);
+ error_at (DECL_SOURCE_LOCATION (decl),
+ "%qE attribute applies only to functions", name);
*no_add_attrs = true;
}
else if (DECL_INITIAL (decl))
{
- error ("%Jcan%'t set %qE attribute after definition", decl, name);
+ error_at (DECL_SOURCE_LOCATION (decl),
+ "can%'t set %qE attribute after definition", name);
*no_add_attrs = true;
}
else
@@ -7046,12 +7052,14 @@ handle_no_limit_stack_attribute (tree *node, tree name,
if (TREE_CODE (decl) != FUNCTION_DECL)
{
- error ("%J%qE attribute applies only to functions", decl, name);
+ error_at (DECL_SOURCE_LOCATION (decl),
+ "%qE attribute applies only to functions", name);
*no_add_attrs = true;
}
else if (DECL_INITIAL (decl))
{
- error ("%Jcan%'t set %qE attribute after definition", decl, name);
+ error_at (DECL_SOURCE_LOCATION (decl),
+ "can%'t set %qE attribute after definition", name);
*no_add_attrs = true;
}
else
OpenPOWER on IntegriCloud