This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: backslash whitespace newline



On Oct 25, 2005, at 5:40 PM, Joe Buck wrote:
The problem, I think, is that the behavior of both GCC *and* the
other compilers does not serve the users.

The reason is that there simply isn't any reason why a user would
use a backslash to continue a C++ comment on purpose, and plenty of
reason why she might do it by accident.

...users think they can put anything in a comment. A backslash at the end is likely to be an accident,
since just starting the next line with a // is easy enough.

Yes. From the user's point of view, the best thing appears to be treating backslashes in C++ comments as part of the comment, regardless of what follows them; that seems to follow the principle of least surprise. That's not standard conforming, and therefore I'm not advocating it for gcc, but it probably wouldn't break anything outside compiler testsuites. Maybe this treatment should be made standard conforming...?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]