|Pointers in C email@example.com (Phil Pfeiffer) (1988-07-05)|
|Re: Pointers in C firstname.lastname@example.org (1988-07-06)|
|Re: Pointers in C email@example.com (1988-07-06)|
|Re: Pointers in C firstname.lastname@example.org (1988-07-13)|
|From:||email@example.com (Louis A. Mamakos)|
|Date:||6 Jul 88 04:21:34 GMT|
|Organization:||University of Maryland, College Park|
i use a compiler which really enforces the rule of comparing (or operating)
on two pointers pointing at the same object. The compiler is for a Unisys 1100
mainframe, which is a ones-complement, 36 bit, word addressable machine. This
thing is a walking validation test for well written C programs.
Its pointers are generally 2 words (8 9-bit bytes) long, except for pointer to
functions which are 8 words (64 9-bit bytes) long. Even with all of the
obvious adversities, it is not difficult to write C code. You have to watch
out for code which thinks that pointers can be put into ints (or longs) and
then back again, but other than that, things work.
You will also see problems like this, I suspect, on 8086 type segmented
architectures. Or so it would seem; I don't use such things.
Now, if I can just convince people that
-1 <> ~0
you see, on a one's complement computer you have both +0 and -0 and
-0 == ~0
Louis A. Mamakos WA3YMH Internet: louie@TRANTOR.UMD.EDU
University of Maryland, Computer Science Center - Systems Programming
Return to the
Search the comp.compilers archives again.