negative addresses

Doug Gwyn gwyn at brl-smoke.ARPA
Sat May 14 05:55:39 AEST 1988


In article <1988May12.162906.16901 at utzoo.uucp> henry at utzoo.uucp (Henry Spencer) writes:
>Unfortunately, it is a real problem, because there are zillions of
>programs that implicitly assume that pointers are all-zeros.

I don't think this is true.  How about an example?

>... uninitialized static variables are
>*not* initialized to all-zeros, they are initialized to the zero value
>of their data type, which means the null pointer for pointers.  Now this
>would be a bit of a pain for compilers on machines with odd representations
>of the null pointer.

Not that much of a problem, really.  The compiler knows about static
data at compile time, and if not explicitly initialized it can output
something like
	ptrname: .word 0xF0F0F0F0 ; null pointer pattern
in the data section of the code it generates.



More information about the Comp.lang.c mailing list