On Mon, 1 Mar 2010, Bob Ammerman wrote: > > On 2010-03-01 17:58, Bob Ammerman wrote: > >> > >> > >>> I know, but there is something funny going on. I looked at it with > >>> 'xxd' and you have a CR/^M/0x0D with no LF/0x0A, and I will bet that's > >>> confusing the compiler. > >> > >> If that's what is confusing the compiler then the compiler is broken. CR > >> and > >> LF are both defined as whitespace characters and any number of > >> consecutive > >> whitespace characters is treated as equivalent to a single space. > >> > >> -- Bob Ammerman > >> RAm System > >> > > > > whitespace != newline. > > whitespace is one of: > > space > tab > newline (aka linefeed) > carriage return > form feed > vertical tab > > and possibly others in extended characters sets (like Unicode). > I wish it were that simple :-) A compiler relies on end-of-line (whatever you decide it should be) to identify where in the source an error has occured. Not only that, but if the compiler is to emit source level debug information for the debugger (so that it can display where in the source the executing program is) then this is another reason why the compiler needs to differentiate between white spase and end-of-line. end-of-line needs to be well defined and strictly observed. What combination of CR/LF is treated as a end-of-line? If the compiler encounters CR on its own should it be treated as end-of-line? Should CR/LF be treated the same as LF/CR? Should CR/CR/LF be treated as 1 end-of-line or 2? What about LF/LF/CR? what happens when you mix and match LF and CR as end-of-line in the same source? How many end-of-line is one "vertical tab" or "form feed" equivalent too? It is far far simpler for the compiler (or preprocessor) to catch unexpected special characters and flag these as an error and use the system wide well defined end-of-line than it is for the compiler to guess what an out of place special character should actually mean. Regards Sergio Masci -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist