logoalt Hacker News

LPisGoodlast Thursday at 5:38 PM2 repliesview on HN

Noncompliant, but what could this reasonably impact?


Replies

o11clast Thursday at 5:46 PM

Pointers are frequently used as keys for map-like data structures. This introduces collisions that the programmer can't check for, whereas NULL is very often special-cased.

bobmcnamaralast Thursday at 5:41 PM

> Noncompliant, since `malloc(0)` is specified to return a unique pointer if it's not `NULL`.

I know I've seen that somewhere, but may I ask what standard you're referring to?

show 1 reply