#POSIX1

2025-06-27

@cks @whitequark

It's interesting comparing Usenet of 1993 to Hacker News of today. Some questions are perennial, it seems:

"But what use is malloc(0)?" followed by a discussion of people rolling their own Pascal-like strings.

"Why unique?" followed by a discussion of making sets and maps.

"It's not a valid pointer." leading to the usual pantomime rejoinder.

I haven't seen anyone ask what the old implementations that returned NULL did to errno, though.

#CLanguage #StandardC #C89 #POSIX1 #malloc #SVID

2025-06-26

@cks @whitequark

Back in 1993, #AIX was the example that people gave of a C library where malloc(0) returned NULL.

groups.google.com/g/comp.unix.

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.

#CLanguage #StandardC #C89 #POSIX1 #malloc #SVID

Client Info

Server: https://mastodon.social
Version: 2025.07
Repository: https://github.com/cyevgeniy/lmst