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: resolving backslash newline whisky tango foxtrot: a proposal


Joe Buck <Joe.Buck@synopsys.COM> writes:

| > > -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. 
| 
| On Thu, Oct 27, 2005 at 02:35:38PM -0400, Andrew Pinski wrote:
| > We already have this included in -Wall via -Wcomment.
| 
| No, we don't.  Consider
| 
| --------------------------
| // this is a continued comment \
| // but who cares, because this is a comment too
| int i = 1;
| --------------------------
| 
| % gcc -Wall -c foo.C
| foo.C:1:1: warning: multi-line comment

That one is particular annoying (in its current form).  I have codes
with such backslashes coming from diagrams embedded in comments
and GCC insist in telling me that I have a multi-line comment.  Now, I
have to tell students that they need to say -Wall followed by bunch of
-Wno-xxx because GCC is being overly helping with no much effort of
"understanding". 

| Under the description I provided, there would be no warning, because
| the continued comment does not change which text is commented out.
| The "line art" people aren't going to find this acceptable.

I certainly do.

| Perhaps the thing to do is to fix -Wcomment to eliminate the noise,
| so it will be more useful; then we don't need a new -W option.

I strongly support that suggestion.

-- Gaby


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