On Mon, 2 May 2022, 13:26 Marc Glisse via Gcc, <gcc@gcc.gnu.org> wrote:

> On Mon, 2 May 2022, Boris Kolpackov wrote:
>
> > Jakub Jelinek <ja...@redhat.com> writes:
> >
> >> The first release candidate for GCC 12.1 is available [...]
> >
> > There is an unfixed bogus warning that is a regression in 12
> > and that I think will have a pretty wide effect (any code
> > that assigns/appends a 1-char string literal to std::string):
> >
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105329
> >
> > For example, in my relatively small codebase I had about 20
> > instances of this warning. Seeing that it's enabled as part
> > of -Wall (not just -Wextra), I believe there will be a lot
> > of grumpy users.
> >
> > There is a proposed work around in this (duplicate) bug that
> > looks pretty simple:
> >
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104336
> >
> > Perhaps it makes sense to consider it?
>
> Please no, that workaround looks like a fragile hack (basically writing
> a+b-a to obfuscate b) that may break if you look at it sideways and likely
> makes the generated code a bit worse.


Agreed. And it makes the variable names completely misleading (although
that would be easy to fix).

Reply via email to