Problem is that I agree with all the points made ;-) Definitely with not relying on uninitialized values.
I will look again at not initializing things that I don't know the type of as I no longer remember why that was going to be an issue. If I thought that all C users would be fine with that, then I would not do it. I know that the generated code relies on certain things being initialized - maybe that was the issue. I'll come back to the list on this one and comment the source definitively. Jim > -----Original Message----- > From: Gavin Lambert [mailto:[email protected]] > Sent: Wednesday, December 09, 2009 1:52 AM > To: Gokulakannan Somasundaram; Jim Idle > Cc: [email protected] > Subject: Re: [antlr-interest] Reporting a bug in C Target > > 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... ;) List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address -- You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en.
