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

2019-01-10 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81452

--- Comment #4 from Eric Gallager  ---
(In reply to Martin Sebor from comment #3)
> There is -Walloc-zero.  If we want a separate knob for just it then maybe
> -Wrealloc-zero.

Oh right, -Walloc-zero, I forgot about that one. It triggers so rarely that
it's probably safe to keep this proposed warning under that single flag.

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

2019-01-09 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81452

--- Comment #3 from Martin Sebor  ---
There is -Walloc-zero.  If we want a separate knob for just it then maybe
-Wrealloc-zero.

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

2019-01-09 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81452

--- Comment #2 from Eric Gallager  ---
any ideas for a name for this proposed warning?

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

2017-08-29 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81452

Eric Gallager  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  ---
Confirmed:

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

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

(no warnings)

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

2017-07-15 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81452

Martin Sebor  changed:

   What|Removed |Added

   Keywords||diagnostic
URL||http://www.open-std.org/jtc
   ||1/sc22/wg14/www/docs/summar
   ||y.htm#dr_400
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=56370
   Severity|normal  |enhancement