This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
resolving backslash newline whisky tango foxtrot: a proposal
- From: Joe Buck <Joe dot Buck at synopsys dot COM>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 27 Oct 2005 11:22:20 -0700
- Subject: resolving backslash newline whisky tango foxtrot: a proposal
Daniel was right in that the discussion has degenerated. So, here's
a concrete proposal. Think of it as a start on a documentation patch.
Since there is no consensus, it seems that the right solution is to
have options. I think that the following concept can solve the problems.
-fno-eol-whitespace-strip
If this flag is specified, then only '\\$', not '\\ *$', causes a line
to be continued. (We default to current gcc behavior, which is
-feol-whitespace-strip).
-Wcontinued-cpp-comment
Warn if there is a C++-style comment that is continued by a backslash at
the end of the line, and the following line contains something other
than whitespace and comments. The current setting of
-f{no-}eol-whitespace-strip is used to decide what is a continued
comment.
-Wcontinued-cpp-comment could be included in -Wall, or not; we could
experiment with codebases to see what gets flagged. I think it's a
good idea to put it there, though.
Apple's customer could use -fno-eol-whitespace-strip, and the warning
would flag any line art that loses its trailing space (for cases where
it matters). The warning, if implemented correctly, will be silent
except for surprises where text gets commented out unexpectedly.
An additional possiblity would be
-fno-cpp-continued-comments
This flag causes the compiler to diverge from the ISO C and C++
standards! If it is specified, then a trailing backslash in a C++-style
comment is simply ignored.