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

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Martin Liška from comment #7)
> > I also think warning on malloc(0) can be useful.  GCC 7 has -Walloc-zero
> > that warns on all zero-size allocations.  Unfortunately, it's not in -Wall
> > or -Wextra and has to be explicitly enabled.
> 
> That's a pity, why was the option not enabled in either -Wall or -Wextra?

I think one of the reasons was that it is a late warning, so it has similar
problems -Wnonnull had, warning even just in cases where path isolation decided
to isolate some call where it just isn't called with those arguments.
So perhaps moving it to post_ipa_warn pass would help with that part.

Reply via email to