https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78902
--- Comment #4 from Marc Glisse <glisse at gcc dot gnu.org> --- (In reply to Martin Liška from comment #3) > Yep, it's strange, should be p = NULL. As mentioned in MAN page: > If size is 0, then malloc() returns either NULL, or a unique pointer value > that can later be successfully passed to free(). While I would personally be happy with malloc(0) always returning 0, IIRC some platforms actually guarantee that malloc(0) returns a unique non-null pointer and may be unhappy about the compiler contradicting them. I may misremember though. (thanks for the PR and the patch, by the way)