[Bug c/80528] reimplement gnulib's "useless-if-before-free" script as a compiler warning

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Apr 26 13:46:00 GMT 2017


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Well, if the user knows that the pointer is usually NULL, then if (p) free (p);
is a significant optimization over free (p).  So as code size optimization,
removing it is fine, but otherwise, it isn't at all clear.


More information about the Gcc-bugs mailing list