Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B UNSW 1.0 3/14/84; site physiol.OZ Path: utzoo!linus!decvax!mulga!munnari!basser!physiol!john From: john@physiol.OZ (John Mackin) Newsgroups: net.lang.c Subject: ints vs. pointers Message-ID: <80@physiol.OZ> Date: Thu, 15-Nov-84 00:20:29 EST Article-I.D.: physiol.80 Posted: Thu Nov 15 00:20:29 1984 Date-Received: Sat, 10-Nov-84 21:28:46 EST Organization: Physiology, Uni of Sydney, Australia Lines: 16 I can remain silent no longer. In the debate about NULL vs non-NULL, people seem to be overlooking the fact that the number of actual "data" bits (as opposed to "noise" bits such as object size, etc., used on some CPUs) in a pointer MUST BE no bigger than the number of bits in an int! [Before the flames start I KNOW K&R's not a standard but it's the closest we've got.] I refer you to Appendix A, para 7.4 (page 189 in my edition): If two pointers of the same type are subtracted, the result is con- verted (by division by the length of the object) to an int representing the number of objects separating the pointed-to objects. This is clearly not necessarily possible if you have (say) 32-bit pointers (with ALL 32 bits being address) and 16-bit ints. John Mackin, Physiology Department, University of Sydney, Sydney, Australia ...!decvax!mulga!john.physiol.su