JdeBP<p><span class="h-card" translate="no"><a href="https://mastodon.social/@cks" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>cks</span></a></span> <span class="h-card" translate="no"><a href="https://mastodon.social/@whitequark" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>whitequark</span></a></span></p><p>Back in 1993, <a href="https://mastodonapp.uk/tags/AIX" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>AIX</span></a> was the example that people gave of a C library where malloc(0) returned NULL.</p><p><a href="https://groups.google.com/g/comp.unix.aix/c/lstmVEcmD2Q/m/wRsWt_Tnw1UJ" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">groups.google.com/g/comp.unix.</span><span class="invisible">aix/c/lstmVEcmD2Q/m/wRsWt_Tnw1UJ</span></a></p><p>Most of the C libraries that I touched back then either just handed off to the operating system's API for suballocation, which did not treat zero specially, or had their own suballocation functions, which did not treat zero specially.</p><p><a href="https://mastodonapp.uk/tags/CLanguage" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CLanguage</span></a> <a href="https://mastodonapp.uk/tags/StandardC" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>StandardC</span></a> <a href="https://mastodonapp.uk/tags/C89" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>C89</span></a> <a href="https://mastodonapp.uk/tags/POSIX1" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>POSIX1</span></a> <a href="https://mastodonapp.uk/tags/malloc" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>malloc</span></a> <a href="https://mastodonapp.uk/tags/SVID" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>SVID</span></a></p>