This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: backslash whitespace newline
- From: Robert Dewar <dewar at adacore dot com>
- To: Bernd Jendrissek <berndj at prism dot co dot za>
- Cc: Kean Johnston <jkj at sco dot com>, Joe Buck <Joe dot Buck at synopsys dot COM>, Mike Stump <mrs at apple dot com>,Andrew Pinski <pinskia at physics dot uc dot edu>, Howard Hinnant <howard dot hinnant at gmail dot com>, gcc at gcc dot gnu dot org
- Date: Thu, 27 Oct 2005 06:39:35 -0400
- Subject: Re: backslash whitespace newline
- References: <435F4AEF.5020607@sco.com> <20051027090311.GA21516@prism.co.za>
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).