[antlr-interest] Reporting a bug in C Target

Jim Idle jimi at temporal-wave.com
Thu Dec 10 08:49:10 PST 2009


If you want to try it out then you will be able to download the snapshot release of the ANTLR tool later today, once I upgrade Hudson so that it builds it again. The runtime has not changed, just the templates.
 
Jim
 
From: Gokulakannan Somasundaram [mailto:gokul007 at gmail.com] 
Sent: Thursday, December 10, 2009 2:36 AM
To: Jim Idle
Cc: David-Sarah Hopwood; antlr-interest at antlr.org
Subject: Re: [antlr-interest] Reporting a bug in C Target
 
Jim, 
    I read about the initialization rules and i agree with them. Thanks for fixing it so quickly. 

Gokul.
On Thu, Dec 10, 2009 at 10:15 AM, Jim Idle <jimi at temporal-wave.com> wrote:
On Wed, 09 Dec 2009 19:54:51 -0800

 "Gokulakannan Somasundaram" <gokul007 at gmail.com> wrote:
 

Assigning it to 0, will again cause trouble for C++ folks.


No it won't, because 0 is a valid (indeed, the preferred) way of writing
a null pointer constant in C++.



I think you misunderstood me. I said assigning 0 to a enum in C++ will throw a compiler error. 
 
I didn't though :). See email about new initialization rules. I think that they are much mire in keeping with C and C++. More generally it makes the grammar programmer responsible for behaviour, which is in line with the rest of the C stuff.

David's point about C++ is correct though 0 == NULL is guranteed in ANSI C, evenbthough rhe compiler must work it out. Better to use NULL consistently and try to avoid adding to the billion dollars.

Jim

Gokul.



 
 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20091210/ad2424fb/attachment.html 


More information about the antlr-interest mailing list