Re: Pointers in C

louie@trantor.umd.edu (Louis A. Mamakos)
6 Jul 88 04:21:34 GMT

          From comp.compilers

Related articles
Pointers in C pfeiffer@herve.cs.wisc.edu (Phil Pfeiffer) (1988-07-05)
Re: Pointers in C louie@trantor.umd.edu (1988-07-06)
Re: Pointers in C mrspock@hubcap.clemson.edu (1988-07-06)
Re: Pointers in C daveb@geac.uucp (1988-07-13)
| List of all articles for this month |
From: louie@trantor.umd.edu (Louis A. Mamakos)
Newsgroups: comp.compilers
Date: 6 Jul 88 04:21:34 GMT
References: <1262@ima.ISC.COM>
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


Fun stuff.


Louis A. Mamakos WA3YMH Internet: louie@TRANTOR.UMD.EDU
University of Maryland, Computer Science Center - Systems Programming
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.