https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98753

Akim Demaille <akim.demaille at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |akim.demaille at gmail dot com

--- Comment #2 from Akim Demaille <akim.demaille at gmail dot com> ---
Hi,

I can't tell if it's the same bug of not, but there have never complaints about
this piece of code before GCC11, so something has most likely changed recently.
 Note also that the 'free' is under an 'if' that clearly makes the diagnostic
wrong (I mean, there's no need to solve the halting problem here, all the
information is statically available).

Besides, I would like to stress something that was said in the other PR
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54202#c6):

> If you can't fix GCC so that it can prove that the free is on a non-heap 
> object, then please change the warning to indicate that GCC may be wrong. For 
> example:
> 
> warning: free() may be called with non-heap object 'name'

Thiago Macieira is right: the warning claims "there is an error", but it only
*suspects* that there is one.  The wording is misleading and should be fixed.

Cheers!

Reply via email to