This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch][Docs] Update dllimport documentation


The rewrite of dllimport code in March

http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=123344

allowed pointers to dllimport'd functions
to be used as constant initializers.  This documents that change.

Tested on i686-pc-mingw32.


2007-11-09  Danny Smith  <dannysmith@users.sourceforge.net>

	* doc/extend.texi (dllimport): Document that pointers to dllimport'd
	functions can be used as constant.


Index: extend.texi
===================================================================
--- extend.texi	(revision 129972)
+++ extend.texi	(working copy)
@@ -2126,9 +2126,12 @@
 functions, using the attribute for a variable eliminates a thunk in
 the DLL@.

-One drawback to using this attribute is that a pointer to a function
-or variable marked as @code{dllimport} cannot be used as a constant
-address.  On Microsoft Windows targets, the attribute can be disabled
+One drawback to using this attribute is that a pointer to a
+@emph{variable} marked as @code{dllimport} cannot be used as a constant
+address. However, a pointer to a @emph{function} with the
+@code{dllimport} attribute can be used as a constant initializer; in
+this case, the address of a stub function in the import lib is
+referenced.  On Microsoft Windows targets, the attribute can be disabled
 for functions by setting the @option{-mnop-fun-dllimport} flag.

 @item eightbit_data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]