This is the mail archive of the gcc-help@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: bug in gcc


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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]