[Bug 151] New: Pragma without ';' results in undefined symbols

Chris Miller chris at dprogramming.com
Wed May 24 09:58:09 PDT 2006


On Wed, 24 May 2006 12:31:15 -0400, Thomas Kuehne <thomas-dloop at kuehne.cn>  
wrote:

> 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
>

Doesn't seem right, notice:

pragma(ident)   // influence block of declarations
{   declaration;
     declaration;
}

doesn't have ";" after the block. Anyway, the way you say wouldn't be  
consistent with other things, like "extern(C) void foo() {}" doesn't need  
";" after. Plus, would that extra ";" have any significance? seems like it  
would only require extra work in the compiler to enforce. I think  
"pragma(ident) declaration; // influence one declaration" should not  
include the ";" and it was only typed in there by habit and/or to look  
like valid code.



More information about the Digitalmars-d-bugs mailing list