[PATCH v2 3/4] Say malloc (0) != NULL is now common; resection

Paul Eggert eggert@cs.ucla.edu
Thu Feb 12 20:54:01 GMT 2026


On 2/12/26 12:45, DJ Delorie wrote:
> There's a difference
> between "I made it work on all the platforms I tried it on" (porting)
> and "I made it work by reading the spec and following it" (portable).> When you say which platforms do what, you're encouraging the former (not
> that I'm opposed to giving them this information, just saying).

To clarify this I could add further wording saying something like "There 
are two possible behaviors, and everybody but IBM AIX does it the GNU way."


> True, but the manual *is* giving more guidance than just "read the
> spec".  If this is a problem area, describing the problem and offering
> workarounds is reasonable.  One workaround here is to just not pass
> zero.

Yes, and PATCH v2 3/4 suggests that workaround first. As an alternative 
it also suggests a different workaround that is also valid. (I've used 
both workarounds.)


More information about the Libc-alpha mailing list