News for hackers. Stuff that matters.
Re:The Ten Commandments for C Programmers (1987) by microtherion on Saturday May 23, 2020 @01:51PM (#23284930)
You're right, I was misinterpreting the language of the standard.

As a practical matter, C implementations typically define NULL as a void pointer, so the cast is not necessary in those implementations (In C++ pre C++11, NULL is always defined as a literal 0, so the cast is definitely necessary).

But it appears the standard allows C implementations to define NULL as a literal 0 or as 0L as well, so the cast is needed in portable code.

There are no comments on this comment yet.