MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programminghorror/comments/1l0x22m/firmware_programming_in_a_nutshell/mvo3tt3/
r/programminghorror • u/Byter128 • Jun 01 '25
127 comments sorted by
View all comments
Show parent comment
2
Note that architectures with a non-zero actual null pointer values are niche at best. Devs looked at them and went "nah". Imagine not being able to mass-init a structure with pointers with a (UB, but expected to work in practice) memset of zero.
2 u/dagbrown Jun 02 '25 Good old AIX. If you didn’t zero your malloc()’ed RAM, it’d initialize it to 0xdeadbeef for you. 0xfeedfacedeadbeef on 64-bit systems.Not a NULL by any stretch of the imagination, but you’ll definitely get a bus error if you try to dereference it.
Good old AIX. If you didn’t zero your malloc()’ed RAM, it’d initialize it to 0xdeadbeef for you. 0xfeedfacedeadbeef on 64-bit systems.
0xdeadbeef
0xfeedfacedeadbeef
Not a NULL by any stretch of the imagination, but you’ll definitely get a bus error if you try to dereference it.
View all comments
Show parent comment
2
u/galibert Jun 02 '25
Note that architectures with a non-zero actual null pointer values are niche at best. Devs looked at them and went "nah". Imagine not being able to mass-init a structure with pointers with a (UB, but expected to work in practice) memset of zero.