[antlr-interest] Reporting a bug in C Target

Gavin Lambert antlr at mirality.co.nz
Wed Dec 9 01:51:46 PST 2009


At 14:07 9/12/2009, Gokulakannan Somasundaram wrote:
>Actually, i want to suggest the memset option only for making it 
>work with enums and not with C++ objects as i mentioned before. 
>Since people expect C target to work with enums, i made that 
>suggestion.

Another possibility, if you want to keep the per-member 
initialisation: what about using 0 as an initialiser rather than 
NULL?  If I'm remembering the C rules properly (though things are 
slightly different in C++), 0 is a valid initialiser for every 
scalar type (integer, floating-point, pointer, enum) -- unlike 
NULL, which is specifically typed to be a pointer.

Though I'm still not entirely convinced that there should be any 
default initialisation at all.  If people are relying on the 
values of uninitialised variables then they deserve the weirdness 
they get... ;)



More information about the antlr-interest mailing list