Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!husc6!seismo!rochester!kodak!grodberg From: grodberg@kodak.UUCP Newsgroups: comp.lang.c Subject: Re: pointer debate raging on... Message-ID: <826@kodak.UUCP> Date: Tue, 28-Apr-87 19:58:12 EDT Article-I.D.: kodak.826 Posted: Tue Apr 28 19:58:12 1987 Date-Received: Thu, 30-Apr-87 01:49:19 EDT References: <149@sds.UUCP> <31@thirdi.UUCP> <17498@sun.uucp> Reply-To: grodberg@kodak.UUCP (Jeremy Grodberg) Organization: Eastman Kodak Co, Rochester, NY Lines: 29 Keywords: pointers, religion, sin, Ritchie, razor blades, etc. In article <17498@sun.uucp> guy%gorodish@Sun.COM (Guy Harris) writes: >>... we use a >> specifically typed nil pointer for each and every type. >> This method has stood us in good stead (except when we have foolishly >> violated it) in porting a source-level debugger to over 70 different >> systems - not all of which were done by followers of the True Faith. > >Umm, err, it's not a matter of "faith", so the use of terms connoting >religion is inappropriate and somewhat irritating here. K&R is quite >clear on this matter; if somebody doesn't "believe in" K&R (or ANSI >C), they're perfectly welcome to implement some language that does >things otherwise, they're just not welcome to call it C. Unfortunately, a lot of compiler writers have produced compilers which they think are C and sell as C, but are not C. I have worked with enough brain-damaged pseudo-C compilers masquerading as real C compilers to appreciate any advice which will help make code transportable to sub-standard compilers while not harming compatiblity with real C compilers. Explicitly casting nil pointers should not cause any problem on real C compilers (if 0 represents a proper nil pointer, than casting 0 to a pointer should not have any effect at all), yet it can certainly looks like it will keep most of the pseudo-C compilers from breaking. Yes, we can't make everything work everywhere, but it doesn't really hurt to write compiler tolerant code, and the butt you save may be your own. -- Jeremy Grodberg Usenet: ...rochester!kodak!grodberg or kodak!grodberg@cs.rochester.edu Arpa: grodberg@kodak or kodak!grodberg@rochester