Hi guys, On 4/17/07, kernels_nz <kernels@slingshot.co.nz> wrote: > Excellent catch about using comments in defines, it has caught me out > in the past because: > > #define max 100 //largest value > > in the line > > for (count = 0; count < max; count++) > > will turn into something like: > > for (count = 0; count < 100 //largest value; count++) > > which obviously wouldnt work. Actually, that should work just fine. Because according to the language specification comments are supposed to be treated as white space. I know that GCC will actually replace comments with whitespace prior to passing the code onto the compiler. Perhaps other compilers aren't doing the right thing... -- Dave Hylands Vancouver, BC, Canada http://www.DaveHylands.com/
Message
Re: [AVR-Chat] Re: Strange compiler warnings?
2007-04-17 by Dave Hylands
Attachments
- No local attachments were found for this message.