Commit 81a6341d by Danny Smith Committed by Danny Smith

re PR bootstrap/11455 (Bootstrap failure in Cygwin)

	PR bootstrap/11455
	* config/i386/winnt.c: Replace use of error(), warning() with
	error_with_decl(), warning_with_decl(),  throughout.

From-SVN: r69107
parent 21789816
2003-07-08 Danny Smith <dannysmith@users.sourceforge.net>
PR bootstrap/11455
* config/i386/winnt.c: Replace use of error(), warning() with
error_with_decl(), warning_with_decl(), throughout.
2003-07-08 Neil Booth <neil@daikokuya.co.uk> 2003-07-08 Neil Booth <neil@daikokuya.co.uk>
* opts.c (wrap_help): Use unsigned int, not size_t. * opts.c (wrap_help): Use unsigned int, not size_t.
......
...@@ -106,8 +106,7 @@ ix86_handle_dll_attribute (pnode, name, args, flags, no_add_attrs) ...@@ -106,8 +106,7 @@ ix86_handle_dll_attribute (pnode, name, args, flags, no_add_attrs)
if (TREE_CODE (node) == FUNCTION_DECL && DECL_INITIAL (node) if (TREE_CODE (node) == FUNCTION_DECL && DECL_INITIAL (node)
&& !DECL_INLINE (node)) && !DECL_INLINE (node))
{ {
error ("%Hfunction `%D' definition is marked dllimport.", error_with_decl (node, "function `%s' definition is marked dllimport.");
&DECL_SOURCE_LOCATION (node), node);
*no_add_attrs = true; *no_add_attrs = true;
} }
...@@ -115,8 +114,7 @@ ix86_handle_dll_attribute (pnode, name, args, flags, no_add_attrs) ...@@ -115,8 +114,7 @@ ix86_handle_dll_attribute (pnode, name, args, flags, no_add_attrs)
{ {
if (DECL_INITIAL (node)) if (DECL_INITIAL (node))
{ {
error ("%Hvariable `%D' definition is marked dllimport.", error_with_decl (node,"variable `%s' definition is marked dllimport.");
&DECL_SOURCE_LOCATION (node), node);
*no_add_attrs = true; *no_add_attrs = true;
} }
...@@ -135,8 +133,8 @@ ix86_handle_dll_attribute (pnode, name, args, flags, no_add_attrs) ...@@ -135,8 +133,8 @@ ix86_handle_dll_attribute (pnode, name, args, flags, no_add_attrs)
&& (TREE_CODE (node) == VAR_DECL && (TREE_CODE (node) == VAR_DECL
|| TREE_CODE (node) == FUNCTION_DECL)) || TREE_CODE (node) == FUNCTION_DECL))
{ {
error ("%Hexternal linkage required for symbol '%D' because of '%s' attribute.", error_with_decl (node, "external linkage required for symbol '%s' because of '%s' attribute.",
&DECL_SOURCE_LOCATION (node), node, IDENTIFIER_POINTER (name)); IDENTIFIER_POINTER (name));
*no_add_attrs = true; *no_add_attrs = true;
} }
...@@ -254,8 +252,7 @@ i386_pe_dllimport_p (decl) ...@@ -254,8 +252,7 @@ i386_pe_dllimport_p (decl)
{ {
/* Don't warn about artificial methods. */ /* Don't warn about artificial methods. */
if (!DECL_ARTIFICIAL (decl)) if (!DECL_ARTIFICIAL (decl))
warning ("%H function '%D' is defined after prior declaration as dllimport: attribute ignored", warning_with_decl (decl,"function '%s' is defined after prior declaration as dllimport: attribute ignored.");
&DECL_SOURCE_LOCATION (decl), decl);
return 0; return 0;
} }
...@@ -265,8 +262,7 @@ i386_pe_dllimport_p (decl) ...@@ -265,8 +262,7 @@ i386_pe_dllimport_p (decl)
else if (TREE_CODE (decl) == FUNCTION_DECL && DECL_INLINE (decl)) else if (TREE_CODE (decl) == FUNCTION_DECL && DECL_INLINE (decl))
{ {
if (extra_warnings) if (extra_warnings)
warning ("%Hinline function '%D' is declared as dllimport: attribute ignored.", warning_with_decl (decl, "inline function '%s' is declared as dllimport: attribute ignored.");
&DECL_SOURCE_LOCATION (decl), decl);
return 0; return 0;
} }
...@@ -277,17 +273,16 @@ i386_pe_dllimport_p (decl) ...@@ -277,17 +273,16 @@ i386_pe_dllimport_p (decl)
&& !DECL_EXTERNAL (decl) && context_imp) && !DECL_EXTERNAL (decl) && context_imp)
{ {
if (!DECL_VIRTUAL_P (decl)) if (!DECL_VIRTUAL_P (decl))
error ("%Hdefinition of static data member '%D' of dllimport'd class.", error_with_decl (decl, "definition of static data member '%s' of dllimport'd class.");
&DECL_SOURCE_LOCATION (decl), decl);
return 0; return 0;
} }
/* Since we can't treat a pointer to a dllimport'd symbol as a /* Since we can't treat a pointer to a dllimport'd symbol as a
constant address, we turn off the attribute on C++ virtual 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 else if (TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE
&& (DECL_VIRTUAL_P (decl))) && (DECL_VIRTUAL_P (decl)))
return 0; return 0;
return 1; return 1;
} }
...@@ -337,8 +332,7 @@ i386_pe_mark_dllexport (decl) ...@@ -337,8 +332,7 @@ i386_pe_mark_dllexport (decl)
abort (); abort ();
if (i386_pe_dllimport_name_p (oldname)) if (i386_pe_dllimport_name_p (oldname))
{ {
warning ("%Hinconsistent dll linkage for '%D, dllexport assumed.", warning_with_decl (decl,"inconsistent dll linkage for '%s': dllexport assumed.");
&DECL_SOURCE_LOCATION (decl), decl);
/* Remove DLL_IMPORT_PREFIX. */ /* Remove DLL_IMPORT_PREFIX. */
oldname += strlen (DLL_IMPORT_PREFIX); oldname += strlen (DLL_IMPORT_PREFIX);
DECL_NON_ADDR_CONST_P (decl) = 0; DECL_NON_ADDR_CONST_P (decl) = 0;
...@@ -389,8 +383,7 @@ i386_pe_mark_dllimport (decl) ...@@ -389,8 +383,7 @@ i386_pe_mark_dllimport (decl)
/* Already done, but do a sanity check to prevent assembler errors. */ /* Already done, but do a sanity check to prevent assembler errors. */
if (!DECL_EXTERNAL (decl) || !TREE_PUBLIC (decl)) if (!DECL_EXTERNAL (decl) || !TREE_PUBLIC (decl))
{ {
error ("%Hfailure in redeclaration of '%D': dllimport'd symbol lacks external linkage.", error_with_decl (decl, "failure in redeclaration of '%s': dllimport'd symbol lacks external linkage.");
&DECL_SOURCE_LOCATION (decl), decl);
abort(); abort();
} }
return; return;
...@@ -536,11 +529,9 @@ i386_pe_encode_section_info (decl, rtl, first) ...@@ -536,11 +529,9 @@ i386_pe_encode_section_info (decl, rtl, first)
tree idp = get_identifier (oldname + strlen (DLL_IMPORT_PREFIX)); tree idp = get_identifier (oldname + strlen (DLL_IMPORT_PREFIX));
rtx newrtl = gen_rtx (SYMBOL_REF, Pmode, IDENTIFIER_POINTER (idp)); rtx newrtl = gen_rtx (SYMBOL_REF, Pmode, IDENTIFIER_POINTER (idp));
warning ("%H%s '%D' %s after being referenced with dllimport linkage.", warning_with_decl (decl, "'%s' %s after being referenced with dllimport linkage.",
&DECL_SOURCE_LOCATION (decl), (DECL_INITIAL (decl) || !DECL_EXTERNAL (decl))
TREE_CODE (decl) == VAR_DECL ? "variable" : "function", ? "defined locally" : "redeclared without dllimport attribute");
decl, (DECL_INITIAL (decl) || !DECL_EXTERNAL (decl))
? "defined locally" : "redeclared without dllimport attribute");
XEXP (DECL_RTL (decl), 0) = newrtl; XEXP (DECL_RTL (decl), 0) = newrtl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment