Re: bug in gcc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2016-06-15 at 12:00 +0100, Andrew Haley wrote:
> On 15/06/16 08:49, Mason wrote:
> > 
> > (To be clear, gcc is warning about the /* comment-start token
> > within a // comment.)
> > 
> > Looking at the documentation for the current release:
> > 
> >   https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
> > 
> > -Wcomment
> >     Warn whenever a comment-start sequence '/*' appears in a '/*'
> > comment, or whenever
> >     a Backslash-Newline appears in a '//' comment. This warning is
> > enabled by -Wall.
> > 
> > The doc doesn't mention warning for /* appearing in a // comment.
> Ah yes, you're quite right.  Something is wrong, but I suspect that
> if anything were to be changed it would be the documentation.

I really hope that the code is changed to match the documentation,
rather than the documentation to match the code.  It's extremely useful
to be able to use line comments to comment out blocks of code, and
warnings (which are often forced to errors in development environments)
about multi-line comments within those blocks would seriously impact
that use-case.

I know you can use tricks like #if 0 etc. but comments are clearer and
more flexible (it's easy to comment out parts of ifdef'd code for
example).

Plus I personally don't see much value in warning about this... what's
the failure case being detected here?



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux