aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorJoseph Myers <jsm28@gcc.gnu.org>2005-07-02 11:55:32 +0100
committerJoseph Myers <jsm28@gcc.gnu.org>2005-07-02 11:55:32 +0100
commitdee158440e16ef7272d823b9bd5e6d414968fd8a (patch)
tree3bc7f52a01952579e89d69c80d985e655c418278 /gcc/config
parent77008252819720c987f11b3dade670e2b3ba09b8 (diff)
downloadgcc-dee158440e16ef7272d823b9bd5e6d414968fd8a.zip
gcc-dee158440e16ef7272d823b9bd5e6d414968fd8a.tar.gz
gcc-dee158440e16ef7272d823b9bd5e6d414968fd8a.tar.bz2
toplev.c (default_tree_printer): Handle setting location with '+' flag.
2005-07-02 Zack Weinberg <zack@codesourcery.com> Joseph S. Myers <joseph@codesourcery.com> * toplev.c (default_tree_printer): Handle setting location with '+' flag. * c-objc.common.c (c_tree_printer): Likewise. * c-format.c (gcc_diag_flag_specs): Add '+'. (gcc_cdiag_char_table): Allow '+' flag for tree formats. (format_types_orig): Allow '+' flag for gcc_diag and gcc_cdiag formats. * c-common.c, c-decl.c, c-objc-common.c, c-pragma.c, config/arm/pe.c, config/i386/winnt.c, config/ia64/ia64.c, config/mcore/mcore.c, config/sh/symbian.c, config/sol2.c, config/v850/v850.c, function.c, stor-layout.c, toplev.c, tree-inline.c, tree-optimize.c, tree.c, varasm.c: Use '+' flag instead of %J or %H. Use 'q' flag for quoting. Avoid '.' at end of diagnostics. Use %q+D not %s for a decl. Do not pass excess format arguments where %J is used without %D. cp: * error.c (location_of): Add comment. (locate_error, cp_error_at, cp_warning_at, cp_pedwarn_at): Remove. * cp-tree.h (cp_error_at, cp_warning_at, cp_pedwarn_at): Remove. * call.c, class.c, decl.c, decl2.c, friend.c, init.c, name-lookup.c, parser.c, pt.c, search.c, semantics.c, typeck.c, typeck2.c: Use '+' flag instead of %J, cp_error_at, cp_warning_at or cp_pedwarn_at. Mark up some diagnostic strings with N_. java: * class.c, decl.c, expr.c: Use '+' flag instead of %J. Use 'q' flag for quoting. objc: * objc-act.c: Use '+' flag instead of %J. Use 'q' flag for quoting. testsuite: * gcc.dg/format/gcc_diag-1.c: Update. From-SVN: r101532
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/arm/pe.c4
-rw-r--r--gcc/config/i386/winnt.c26
-rw-r--r--gcc/config/ia64/ia64.c8
-rw-r--r--gcc/config/mcore/mcore.c2
-rw-r--r--gcc/config/sh/symbian.c29
-rw-r--r--gcc/config/sol2.c4
-rw-r--r--gcc/config/v850/v850.c6
7 files changed, 39 insertions, 40 deletions
diff --git a/gcc/config/arm/pe.c b/gcc/config/arm/pe.c
index 9ffdfbb..f2f67d5 100644
--- a/gcc/config/arm/pe.c
+++ b/gcc/config/arm/pe.c
@@ -162,7 +162,7 @@ arm_mark_dllimport (decl)
&& !DECL_VIRTUAL_P (decl)
&& DECL_INITIAL (decl))
{
- error ("%Jinitialized variable '%D' is marked dllimport", decl, decl);
+ error ("initialized variable %q+D is marked dllimport", decl);
return;
}
/* Nor can they be static. */
@@ -171,7 +171,7 @@ arm_mark_dllimport (decl)
&& !DECL_VIRTUAL_P (decl)
&& 0 /*???*/)
{
- error ("%Jstatic variable '%D' is marked dllimport", decl, decl);
+ error ("static variable %q+D is marked dllimport", decl);
return;
}
diff --git a/gcc/config/i386/winnt.c b/gcc/config/i386/winnt.c
index 743acd0..c1c605c 100644
--- a/gcc/config/i386/winnt.c
+++ b/gcc/config/i386/winnt.c
@@ -199,8 +199,8 @@ i386_pe_dllimport_p (tree decl)
{
/* Don't warn about artificial methods. */
if (!DECL_ARTIFICIAL (decl))
- warning (0, "%Jfunction '%D' is defined after prior declaration "
- "as dllimport: attribute ignored", decl, decl);
+ warning (0, "function %q+D is defined after prior declaration "
+ "as dllimport: attribute ignored", decl);
return 0;
}
@@ -210,8 +210,8 @@ i386_pe_dllimport_p (tree decl)
else if (TREE_CODE (decl) == FUNCTION_DECL && DECL_INLINE (decl))
{
if (extra_warnings)
- warning (0, "%Jinline function '%D' is declared as dllimport: "
- "attribute ignored.", decl, decl);
+ warning (0, "inline function %q+D is declared as dllimport: "
+ "attribute ignored", decl);
return 0;
}
@@ -222,8 +222,8 @@ i386_pe_dllimport_p (tree decl)
&& !DECL_EXTERNAL (decl) && context_imp)
{
if (!DECL_VIRTUAL_P (decl))
- error ("%Jdefinition of static data member '%D' of "
- "dllimport'd class.", decl, decl);
+ error ("definition of static data member %q+D of "
+ "dllimport'd class", decl);
return 0;
}
@@ -279,8 +279,8 @@ i386_pe_mark_dllexport (tree decl)
oldname = XSTR (rtlname, 0);
if (i386_pe_dllimport_name_p (oldname))
{
- warning (0, "%Jinconsistent dll linkage for '%D', dllexport assumed.",
- decl, decl);
+ warning (0, "inconsistent dll linkage for %q+D, dllexport assumed",
+ decl);
/* Remove DLL_IMPORT_PREFIX. */
oldname += strlen (DLL_IMPORT_PREFIX);
DECL_NON_ADDR_CONST_P (decl) = 0;
@@ -463,12 +463,12 @@ i386_pe_encode_section_info (tree decl, rtx rtl, int first)
We leave these alone for now. */
if (DECL_INITIAL (decl) || !DECL_EXTERNAL (decl))
- warning (0, "%J'%D' defined locally after being "
- "referenced with dllimport linkage", decl, decl);
+ warning (0, "%q+D defined locally after being "
+ "referenced with dllimport linkage", decl);
else
- warning (OPT_Wattributes, "%J'%D' redeclared without dllimport "
+ warning (OPT_Wattributes, "%q+D redeclared without dllimport "
"attribute after being referenced with dllimport linkage",
- decl, decl);
+ decl);
}
}
@@ -634,7 +634,7 @@ i386_pe_section_type_flags (tree decl, const char *name, int reloc)
else
{
if (decl && **slot != flags)
- error ("%J'%D' causes a section type conflict", decl, decl);
+ error ("%q+D causes a section type conflict", decl);
}
return flags;
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index f8f3463..8f28e20 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -515,21 +515,21 @@ ia64_handle_model_attribute (tree *node, tree name, tree args,
&& !TREE_STATIC (decl))
{
error ("%Jan address area attribute cannot be specified for "
- "local variables", decl, decl);
+ "local variables", decl);
*no_add_attrs = true;
}
area = ia64_get_addr_area (decl);
if (area != ADDR_AREA_NORMAL && addr_area != area)
{
- error ("%Jaddress area of '%s' conflicts with previous "
- "declaration", decl, decl);
+ error ("address area of %q+D conflicts with previous "
+ "declaration", decl);
*no_add_attrs = true;
}
break;
case FUNCTION_DECL:
error ("%Jaddress area attribute cannot be specified for functions",
- decl, decl);
+ decl);
*no_add_attrs = true;
break;
diff --git a/gcc/config/mcore/mcore.c b/gcc/config/mcore/mcore.c
index b01cef8..8237d45 100644
--- a/gcc/config/mcore/mcore.c
+++ b/gcc/config/mcore/mcore.c
@@ -2895,7 +2895,7 @@ mcore_mark_dllimport (tree decl)
&& !DECL_VIRTUAL_P (decl)
&& DECL_INITIAL (decl))
{
- error ("%Jinitialized variable '%D' is marked dllimport", decl, decl);
+ error ("initialized variable %q+D is marked dllimport", decl);
return;
}
diff --git a/gcc/config/sh/symbian.c b/gcc/config/sh/symbian.c
index ef85066..456c23c 100644
--- a/gcc/config/sh/symbian.c
+++ b/gcc/config/sh/symbian.c
@@ -144,9 +144,9 @@ sh_symbian_dllimport_p (tree decl)
{
/* Don't warn about artificial methods. */
if (!DECL_ARTIFICIAL (decl))
- warning (OPT_Wattributes, "%H function '%D' is defined after prior "
+ warning (OPT_Wattributes, "function %q+D is defined after prior "
"declaration as dllimport: attribute ignored",
- & DECL_SOURCE_LOCATION (decl), decl);
+ decl);
return false;
}
@@ -156,9 +156,9 @@ sh_symbian_dllimport_p (tree decl)
else if (TREE_CODE (decl) == FUNCTION_DECL && DECL_INLINE (decl))
{
if (extra_warnings)
- warning (OPT_Wattributes, "%Hinline function '%D' is declared as "
- "dllimport: attribute ignored.",
- & DECL_SOURCE_LOCATION (decl), decl);
+ warning (OPT_Wattributes, "inline function %q+D is declared as "
+ "dllimport: attribute ignored",
+ decl);
return false;
}
@@ -170,8 +170,8 @@ sh_symbian_dllimport_p (tree decl)
&& !DECL_EXTERNAL (decl))
{
if (!DECL_VIRTUAL_P (decl))
- error ("%Hdefinition of static data member '%D' of dllimport'd class.",
- & DECL_SOURCE_LOCATION (decl), decl);
+ error ("definition of static data member %q+D of dllimport'd class",
+ decl);
return false;
}
@@ -277,8 +277,8 @@ sh_symbian_mark_dllimport (tree decl)
{
/* Already done, but do a sanity check to prevent assembler errors. */
if (!DECL_EXTERNAL (decl) || !TREE_PUBLIC (decl))
- error ("%Hfailure in redeclaration of '%D': dllimport'd symbol lacks external linkage.",
- &DECL_SOURCE_LOCATION (decl), decl);
+ error ("failure in redeclaration of %q+D: dllimport'd symbol lacks external linkage",
+ decl);
}
else
{
@@ -323,8 +323,7 @@ sh_symbian_encode_section_info (tree decl, rtx rtl, int first)
tree idp = get_identifier (oldname + strlen (DLL_IMPORT_PREFIX));
rtx newrtl = gen_rtx_SYMBOL_REF (Pmode, IDENTIFIER_POINTER (idp));
- warning (0, "%H%s '%D' %s after being referenced with dllimport linkage.",
- & DECL_SOURCE_LOCATION (decl),
+ warning (0, "%s %q+D %s after being referenced with dllimport linkage",
TREE_CODE (decl) == VAR_DECL ? "variable" : "function",
decl, (DECL_INITIAL (decl) || !DECL_EXTERNAL (decl))
? "defined locally" : "redeclared without dllimport attribute");
@@ -427,8 +426,8 @@ sh_symbian_handle_dll_attribute (tree *pnode, tree name, tree args,
{
if (DECL_INITIAL (node))
{
- error ("%Hvariable %qD definition is marked dllimport.",
- & DECL_SOURCE_LOCATION (node), node);
+ error ("variable %q+D definition is marked dllimport",
+ node);
*no_add_attrs = true;
}
@@ -502,8 +501,8 @@ sh_symbian_handle_dll_attribute (tree *pnode, tree name, tree args,
&& ( TREE_CODE (node) == VAR_DECL
|| TREE_CODE (node) == FUNCTION_DECL))
{
- error ("%Hexternal linkage required for symbol '%D' because of '%s' attribute.",
- & DECL_SOURCE_LOCATION (node), node, IDENTIFIER_POINTER (name));
+ error ("external linkage required for symbol %q+D because of %qs attribute",
+ node, IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
diff --git a/gcc/config/sol2.c b/gcc/config/sol2.c
index f54269d..e3d3147 100644
--- a/gcc/config/sol2.c
+++ b/gcc/config/sol2.c
@@ -51,8 +51,8 @@ solaris_insert_attributes (tree decl, tree *attributes)
{
if (lookup_attribute ("aligned", DECL_ATTRIBUTES (decl))
|| lookup_attribute ("aligned", *attributes))
- warning (0, "%Jignoring %<#pragma align%> for explicitly "
- "aligned %<%D%>", decl, decl);
+ warning (0, "ignoring %<#pragma align%> for explicitly "
+ "aligned %q+D", decl);
else
*attributes = tree_cons (get_identifier ("aligned"), value,
*attributes);
diff --git a/gcc/config/v850/v850.c b/gcc/config/v850/v850.c
index 39d8a47..efc8320 100644
--- a/gcc/config/v850/v850.c
+++ b/gcc/config/v850/v850.c
@@ -2138,7 +2138,7 @@ v850_handle_data_area_attribute (tree* node,
if (current_function_decl != NULL_TREE)
{
error ("%Jdata area attributes cannot be specified for "
- "local variables", decl, decl);
+ "local variables", decl);
*no_add_attrs = true;
}
@@ -2148,8 +2148,8 @@ v850_handle_data_area_attribute (tree* node,
area = v850_get_data_area (decl);
if (area != DATA_AREA_NORMAL && data_area != area)
{
- error ("%Jdata area of '%D' conflicts with previous declaration",
- decl, decl);
+ error ("data area of %q+D conflicts with previous declaration",
+ decl);
*no_add_attrs = true;
}
break;