This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/81452] warn on realloc(p, 0)
- From: "egallager at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 30 Aug 2017 02:06:03 +0000
- Subject: [Bug tree-optimization/81452] warn on realloc(p, 0)
- Auto-submitted: auto-generated
- References: <bug-81452-4@http.gcc.gnu.org/bugzilla/>
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)