This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/54202] Overeager warning about freeing non-heap objects
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 08 Aug 2012 14:36:03 +0000
- Subject: [Bug c/54202] Overeager warning about freeing non-heap objects
- Auto-submitted: auto-generated
- References: <bug-54202-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54202
--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-08-08 14:36:03 UTC ---
(In reply to comment #2)
> To be honest, I don't want false-positive warnings. The code and data are
> constructed so that it never frees the non-heap object (it has a reference
> count of -1). If the driver to this warning can't be improved to be certain,
> I'd recommend at least changing the text, like the -Wuninitialized one:
>
> 'varname' may be used uninitialized in this function
>
> When GCC warnings are assertive, like the "will break strict aliasing" one, we
> go an extra mile to try and fix them.
Note that even for the uninitialized use case we warn for functions
that may be never executed at runtime. So - are you happy with the
definitive warning if the free () call happens unconditionally when
the function is entered?