Compiler bug ?

Jonathan M Davis jmdavisProg at gmx.com
Fri May 17 10:04:56 PDT 2013


On Friday, May 17, 2013 16:40:23 Temtaime wrote:
> Yes, i want to see 'undeclared variable' error, but the compiler
> omits function declaration instead.
> 
> And why i shouldn't use __? I think it's ordinary identifier.

Identifiers begining with two underscores are reserved by the compiler, which 
is why identifiers such as __FILE__, __LINE__, __traits, and __gshared all 
begin with two underscores. Identifiers that the compiler generates are going 
to start with two underscores, and you could end up with bugs in your program 
if you happened to declare an identifier with a name that matched a compiler 
generated one. I believe that that's the case with most C-based languages.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list