Richard Henderson writes: >Dunno. One could also wait to expand *__imp_foo, for functions, >until expanding the function call. And then this variable would >receive the address of the import library thunk. > >What does VC++ do?
It seems to always use *__imp_foo except when initializing a statically allocated variable in C. In that case it uses _foo, unless compiling with extensions disabled (/Za) in which case it generates a similar error as we do. In C++ it uses dynamic initialization like Dave Korn suggested. > I'm mostly wondering about what pointer equality guarantees we can make. It looks like MSC requires that you link with the static CRT libraries if you want strict standard conformance. Ross Ridge