[Bug 151] New: Pragma without ';' results in undefined symbols
Thomas Kuehne
thomas-dloop at kuehne.cn
Wed May 24 09:31:15 PDT 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
d-bugmail at puremagic.com schrieb am 2006-05-23:
> http://d.puremagic.com/bugzilla/show_bug.cgi?id=151
>>type main.d
> import std.stdio;//needs at least 1 import
> pragma(lib,"ws2_32.lib")//;
> class bla{}
> void main(){}
>
>>dmd main.d
> C:\dmd\bin\..\..\dm\bin\link.exe main,,,user32+kernel32/noi;
> OPTLINK (R) for Win32 Release 7.50B1
> Copyright (C) Digital Mars 1989 - 2001 All Rights Reserved
>
> main.obj(main)
> Error 42: Symbol Undefined __Class_4main3bla
> --- errorlevel 1
While
"pragma(lib, "ws2_32.lib") class Blah{}" [A]
is clearly illegal,
"pragma(lib, "ws2_32.lib") class Blah{};" [B]
is legal but buggy.
http://www.dstress.com/d/pragma.html :
> pragma(ident) declaration; // influence one declaration
Thus [B] should provide the symbols of ws2_32.lib only to the Blah
class. I'd opt to state that "lib" and "msg" influence neither
declarations nor statements, thus prohibiting:
pragma(msg, "123") statement;
pragma(msg, "123") declaration;
pragma(msg, "123") { statement }
pragma(msg, "123") { declaration }
pragma(msg, "123"): declaration;
pragma(lib, "123") statement;
pragma(lib, "123") declaration;
pragma(lib, "123") { statement }
pragma(lib, "123") { declaration }
pragma(lib, "123"): declaration;
Added to DStress as
http://dstress.kuehne.cn/nocompile/p/pragma_07_A.d
Thomas
-----BEGIN PGP SIGNATURE-----
iD8DBQFEdDSR3w+/yD4P9tIRAiuzAJ9jcptNccs5ZfxvXlIr6njY8+JDIwCgjE7w
9GuEnjtq5PAQSpnLJieM5+M=
=Xziv
-----END PGP SIGNATURE-----
More information about the Digitalmars-d-bugs
mailing list