From: Danny S. <dan...@cl...> - 2003-02-02 09:15:27
|
----- Original Message ----- From: "Danny Smith" <dan...@cl...> To: <min...@li...> Sent: Saturday, 1 February 2003 19:27 Subject: Re: [MinGW-dvlpr] _CRTIMP problem > > Apparently "fun1" can mean either "__imp__fun1" or the stub "_fun1" to > MSVC > > depending on the context, while in GCC the presence of dllimport > causes only > > references to "__imp__fun1" to be emitted. It seems strange though > that this > > could be the first time this problem was encountered with GCC, because > > storing the address of a dllimport'ed function isn't a particularly > strange > > thing to do. I've just gone through the thread in gcc, starting about here: http://gcc.gnu.org/ml/gcc-patches/1998-06/msg00523.html where much of the dllimport/export code was added. This comment in Mumit's patch to tree.c (staticp) + /* Don't treat global scope DLL imported functions as static since + taking their address involves initialization. */ rationalizes why storing the address of a dllimport'ed function --at gobal scope-- raises an error in C (it is legal in C++ and does not raise the error, but does require a lot of overhead). >> Do you have an idea of how difficult this would be to fix > in > > GCC? > Hmm, I wonder if we can change TARGET_NOP_FUN_DLLIMPORT from a macro into a function that checks global_bindings_p ()... Danny |