News for hackers. Stuff that matters.
Re:The Ten Commandments for C Programmers (1987) by CalChris on Saturday May 23, 2020 @11:00AM (#23283472)
Thou shalt not follow the NULL pointer should probably be appended with and thou shalt not map the zero page.
Re:The Ten Commandments for C Programmers (1987) by beefhash on Saturday May 23, 2020 @11:23AM (#23283657)
Kind of hard when the operating system does it for you... https://groups.google.com/d/msg/comp.unix.aix/0dv4N0qmgVQ/ty...
Re:The Ten Commandments for C Programmers (1987) by CalChris on Saturday May 23, 2020 @12:52PM (#23284452)
OSX (well, OSX ld, not OSX itself) actually does this for you and unmaps the entire low 4GB for good measure, giving new meaning to 32-bit clean.
Re:The Ten Commandments for C Programmers (1987) by greenyoda on Saturday May 23, 2020 @04:16PM (#23286000)
Sometimes, the zero page is available to your C program. For example, your C code could be part of the Linux kernel's boot code, or could be running on embedded hardware.
Re:The Ten Commandments for C Programmers (1987) by beached_whale on Saturday May 23, 2020 @12:22PM (#23284195)
NULL is not the zero page... well at least in the C machine. NULL is NULL. But then again, it does work on systems where it matters(e.g. address 0 is valid and needed)