This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/81452] warn on realloc(p, 0)


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

Eric Gallager <egallager at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2017-08-30
                 CC|                            |egallager at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Eric Gallager <egallager at gcc dot gnu.org> ---
Confirmed:

$ cat 81452.c && /usr/local/bin/gcc -c -Wall -Wextra -pedantic 81452.c
#include <stdlib.h>

int main(void)
{
        void *p = malloc(5);
        p = realloc(p, 0);
        return ((p == NULL) ? 0 : 1);
}
$

(no warnings)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]