if (TREE_CODE (node) == FUNCTION_DECL && DECL_INITIAL (node)
&& !DECL_INLINE (node))
{
- error ("%Hfunction `%D' definition is marked dllimport.",
- &DECL_SOURCE_LOCATION (node), node);
+ error_with_decl (node, "function `%s' definition is marked dllimport.");
*no_add_attrs = true;
}
{
if (DECL_INITIAL (node))
{
- error ("%Hvariable `%D' definition is marked dllimport.",
- &DECL_SOURCE_LOCATION (node), node);
+ error_with_decl (node,"variable `%s' definition is marked dllimport.");
*no_add_attrs = true;
}
&& (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_with_decl (node, "external linkage required for symbol '%s' because of '%s' attribute.",
+ IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
{
/* Don't warn about artificial methods. */
if (!DECL_ARTIFICIAL (decl))
- warning ("%H function '%D' is defined after prior declaration as dllimport: attribute ignored",
- &DECL_SOURCE_LOCATION (decl), decl);
+ warning_with_decl (decl,"function '%s' is defined after prior declaration as dllimport: attribute ignored.");
return 0;
}
else if (TREE_CODE (decl) == FUNCTION_DECL && DECL_INLINE (decl))
{
if (extra_warnings)
- warning ("%Hinline function '%D' is declared as dllimport: attribute ignored.",
- &DECL_SOURCE_LOCATION (decl), decl);
+ warning_with_decl (decl, "inline function '%s' is declared as dllimport: attribute ignored.");
return 0;
}
&& !DECL_EXTERNAL (decl) && context_imp)
{
if (!DECL_VIRTUAL_P (decl))
- error ("%Hdefinition of static data member '%D' of dllimport'd class.",
- &DECL_SOURCE_LOCATION (decl), decl);
+ error_with_decl (decl, "definition of static data member '%s' of dllimport'd class.");
return 0;
}
/* Since we can't treat a pointer to a dllimport'd symbol as a
constant address, we turn off the attribute on C++ virtual
- methods to allow creation of vtables using thunks. */
+ methods to allow creation of vtables using thunks. */
else if (TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE
&& (DECL_VIRTUAL_P (decl)))
- return 0;
+ return 0;
return 1;
}
abort ();
if (i386_pe_dllimport_name_p (oldname))
{
- warning ("%Hinconsistent dll linkage for '%D, dllexport assumed.",
- &DECL_SOURCE_LOCATION (decl), decl);
+ warning_with_decl (decl,"inconsistent dll linkage for '%s': dllexport assumed.");
/* Remove DLL_IMPORT_PREFIX. */
oldname += strlen (DLL_IMPORT_PREFIX);
DECL_NON_ADDR_CONST_P (decl) = 0;
/* 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_with_decl (decl, "failure in redeclaration of '%s': dllimport'd symbol lacks external linkage.");
abort();
}
return;
tree idp = get_identifier (oldname + strlen (DLL_IMPORT_PREFIX));
rtx newrtl = gen_rtx (SYMBOL_REF, Pmode, IDENTIFIER_POINTER (idp));
- warning ("%H%s '%D' %s after being referenced with dllimport linkage.",
- &DECL_SOURCE_LOCATION (decl),
- TREE_CODE (decl) == VAR_DECL ? "variable" : "function",
- decl, (DECL_INITIAL (decl) || !DECL_EXTERNAL (decl))
- ? "defined locally" : "redeclared without dllimport attribute");
+ warning_with_decl (decl, "'%s' %s after being referenced with dllimport linkage.",
+ (DECL_INITIAL (decl) || !DECL_EXTERNAL (decl))
+ ? "defined locally" : "redeclared without dllimport attribute");
XEXP (DECL_RTL (decl), 0) = newrtl;