Bernd Jendrissek wrote:
My vote: I don't like surprises, and I'd like this code:int x; // variable x \\ int y; // variable y \\ to do exactly the same as this code:int x; // variable x \\ int y; // variable y \\ even if that behaviour is not the intent of the programmer.
But really that's a comment on the standard. The standard unfortunately does not agree with your likes and dislikes. I think I like the gcc behavior better in a way, because it points out to the programmer that the above expectation is incorrect. I really think the standard is wrong here .... By the way, I think an excellent coding standard to follow is to completely forbid trailing spaces in all source code (we enforce this for both Ada and C code in the GNAT front end). We also forbid tabs in Ada code (but not in C code, due to fierce pressure from the C folks here, claiming that gcc style requires the tabs) for the same reason (white space changes not visible in printed and displayed copies are a potential menace -- e.g. in generating bogus mismatches for various tools).
