This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: bug in gcc
- From: Paul Smith <paul at mad-scientist dot net>
- To: Andrew Haley <aph at redhat dot com>, Mason <slash dot tmp at free dot fr>, GCC help <gcc-help at gcc dot gnu dot org>
- Date: Wed, 15 Jun 2016 09:16:20 -0400
- Subject: Re: bug in gcc
- Authentication-results: sourceware.org; auth=none
- References: <02132c65-d6f4-b5da-f719-9a25f426e6e3 at jesusnjim dot com> <57604AD7 dot 3080105 at redhat dot com> <57610886 dot 7000001 at free dot fr> <57613545 dot 2040609 at redhat dot com>
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?