Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: comp.lang.c Subject: Re: Passing (char *) NULL to printf to match %s Message-ID: <8416@utzoo.UUCP> Date: Sat, 15-Aug-87 18:22:46 EDT Article-I.D.: utzoo.8416 Posted: Sat Aug 15 18:22:46 1987 Date-Received: Sat, 15-Aug-87 18:22:46 EDT References: <166@qetzal.UUCP> <157@hobbes.UUCP> <875@bsu-cs.UUCP> <24247@sun.uucp>, <10254@orchid.waterloo.edu> Organization: U of Toronto Zoology Lines: 15 > ...Sun's approach > of faulting gets bugs in programs detected much earlier in the > development cycle. Printing "(null)" is roughly equivalent > to quietly mapping an out of bound subscript to zero... It depends on what you are after. For debugging work in particular, printing "(null)" is a significant convenience. As for detecting bugs early... don't you *look* at the printed output?!? I have no strong feelings either way on the issue, actually -- the debugging issue can be handled with '#define NONNULL(s) ((s != NULL) ? s : "(null)")' and a bit of care -- but the justification offered strikes me as bogus. -- Support sustained spaceflight: fight | Henry Spencer @ U of Toronto Zoology the soi-disant "Planetary Society"! | {allegra,ihnp4,decvax,utai}!utzoo!henry