News for hackers. Stuff that matters.
Re:Sshole by miki123211 on Friday November 06, 2026 @05:47AM (#50390721)
Wait, so if you're running on embedded, you're not allowed to store anything at address 0, requiring you to waste that little bit of RAM?

That's... a bizarre choice, considering how religious C is about not making any assumptions about what a machine can and cannot do, even going to the trouble of working with non-IEEE floats and int types that are not a multiple of 8 bits.

Re:Sshole by Xirdus on Friday November 06, 2026 @08:44AM (#50392212)
Unfortunately yes. ISO/IEC 9899:1999 footnote 83: "Among the invalid values for dereferencing a pointer by the unary * operator are a null pointer (...)."
Re:Sshole by jasomill on Monday November 09, 2026 @08:37AM (#50425422)
No. IIRC, you’re just not allowed to use a constant expression evaluating to 0 as a pointer to construct a non-null pointer to address zero.

There’s no requirement that the in-memory representation of a null pointer be all-zeroes, only that 0 in source code represents whatever it is.

Regardless, I agree that it’s a bizarre choice.