aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c45
1 files changed, 17 insertions, 28 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index e6d4197..39c6a57 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -1140,8 +1140,7 @@ fname_decl (unsigned int rid, tree id)
input_line = saved_lineno;
}
if (!ix && !current_function_decl)
- pedwarn ("%H'%D' is not defined outside of function scope",
- &DECL_SOURCE_LOCATION (decl), decl);
+ pedwarn ("%J'%D' is not defined outside of function scope", decl, decl);
return decl;
}
@@ -3936,19 +3935,17 @@ c_add_case_label (splay_tree cases, tree cond, tree low_value,
if (high_value)
{
error ("duplicate (or overlapping) case value");
- error ("%Hthis is the first entry overlapping that value",
- &DECL_SOURCE_LOCATION (duplicate));
+ error ("%Jthis is the first entry overlapping that value", duplicate);
}
else if (low_value)
{
error ("duplicate case value") ;
- error ("%Hpreviously used here", &DECL_SOURCE_LOCATION (duplicate));
+ error ("%Jpreviously used here", duplicate);
}
else
{
error ("multiple default labels in one switch");
- error ("%Hthis is the first default label",
- &DECL_SOURCE_LOCATION (duplicate));
+ error ("%Jthis is the first default label", duplicate);
}
if (!cases->root)
add_stmt (build_case_label (NULL_TREE, NULL_TREE, label));
@@ -4249,7 +4246,7 @@ shadow_warning (enum sw_kind msgcode, const char *name, tree decl)
};
warning (msgs[msgcode], name);
- warning ("%Hshadowed declaration is here", &DECL_SOURCE_LOCATION (decl));
+ warning ("%Jshadowed declaration is here", decl);
}
/* Attribute handlers common to C front ends. */
@@ -4690,8 +4687,8 @@ handle_section_attribute (tree *node, tree name ATTRIBUTE_UNUSED, tree args,
&& current_function_decl != NULL_TREE
&& ! TREE_STATIC (decl))
{
- error ("%Hsection attribute cannot be specified for "
- "local variables", &DECL_SOURCE_LOCATION (decl));
+ error ("%Jsection attribute cannot be specified for "
+ "local variables", decl);
*no_add_attrs = true;
}
@@ -4701,8 +4698,8 @@ handle_section_attribute (tree *node, tree name ATTRIBUTE_UNUSED, tree args,
&& strcmp (TREE_STRING_POINTER (DECL_SECTION_NAME (decl)),
TREE_STRING_POINTER (TREE_VALUE (args))) != 0)
{
- error ("%Hsection of '%D' conflicts with previous declaration",
- &DECL_SOURCE_LOCATION (*node), *node);
+ error ("%Jsection of '%D' conflicts with previous declaration",
+ *node, *node);
*no_add_attrs = true;
}
else
@@ -4710,15 +4707,13 @@ handle_section_attribute (tree *node, tree name ATTRIBUTE_UNUSED, tree args,
}
else
{
- error ("%Hsection attribute not allowed for '%D'",
- &DECL_SOURCE_LOCATION (*node), *node);
+ error ("%Jsection attribute not allowed for '%D'", *node, *node);
*no_add_attrs = true;
}
}
else
{
- error ("%Hsection attributes are not supported for this target",
- &DECL_SOURCE_LOCATION (*node));
+ error ("%Jsection attributes are not supported for this target", *node);
*no_add_attrs = true;
}
@@ -4792,8 +4787,7 @@ handle_aligned_attribute (tree *node, tree name ATTRIBUTE_UNUSED, tree args,
else if (TREE_CODE (decl) != VAR_DECL
&& TREE_CODE (decl) != FIELD_DECL)
{
- error ("%Halignment may not be specified for '%D'",
- &DECL_SOURCE_LOCATION (decl), decl);
+ error ("%Jalignment may not be specified for '%D'", decl, decl);
*no_add_attrs = true;
}
else
@@ -4831,8 +4825,7 @@ handle_alias_attribute (tree *node, tree name, tree args,
if ((TREE_CODE (decl) == FUNCTION_DECL && DECL_INITIAL (decl))
|| (TREE_CODE (decl) != FUNCTION_DECL && ! DECL_EXTERNAL (decl)))
{
- error ("%H'%D' defined both normally and as an alias",
- &DECL_SOURCE_LOCATION (decl), decl);
+ error ("%J'%D' defined both normally and as an alias", decl, decl);
*no_add_attrs = true;
}
else if (decl_function_context (decl) == 0)
@@ -4956,14 +4949,12 @@ handle_no_instrument_function_attribute (tree *node, tree name,
if (TREE_CODE (decl) != FUNCTION_DECL)
{
- error ("%H'%E' attribute applies only to functions",
- &DECL_SOURCE_LOCATION (decl), name);
+ error ("%J'%E' attribute applies only to functions", decl, name);
*no_add_attrs = true;
}
else if (DECL_INITIAL (decl))
{
- error ("%Hcan't set '%E' attribute after definition",
- &DECL_SOURCE_LOCATION (decl), name);
+ error ("%Jcan't set '%E' attribute after definition", decl, name);
*no_add_attrs = true;
}
else
@@ -5004,14 +4995,12 @@ handle_no_limit_stack_attribute (tree *node, tree name,
if (TREE_CODE (decl) != FUNCTION_DECL)
{
- error ("%H'%E' attribute applies only to functions",
- &DECL_SOURCE_LOCATION (decl), name);
+ error ("%J'%E' attribute applies only to functions", decl, name);
*no_add_attrs = true;
}
else if (DECL_INITIAL (decl))
{
- error ("%Hcan't set '%E' attribute after definition",
- &DECL_SOURCE_LOCATION (decl), name);
+ error ("%Jcan't set '%E' attribute after definition", decl, name);
*no_add_attrs = true;
}
else