Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!ames!xanth!mcnc!rti!xyzzy!agarn!throopw From: throopw@agarn.dg.com (Wayne A. Throop) Newsgroups: comp.lang.c Subject: Re: An interesting behaviour in printf Message-ID: <4273@xyzzy.UUCP> Date: 20 Mar 89 19:07:56 GMT References: <960@Portia.Stanford.EDU> <15938@cup.portal.com> <2343@buengc.BU.EDU> <9874@smoke.BRL.MIL> Sender: usenet@xyzzy.UUCP Lines: 22 > gwyn@smoke.BRL.MIL (Doug Gwyn ) > In my version (BRL UNIX System V emulation for 4BSD), I > decided that the test for a null pointer was cheap insurance and I also > have *printf("%s",(char*)0) print "(null)" rather than behave randomly. > Such matters concern what X3J11 dubbed "quality of implementation" issues. Uh... yeah. They involve some taste issues also, so let me add a tangential point. I'd personally prefer not to overload an "in-band" behavior to mean that something "out-of-band" happened. The check for the null pointer is cheap enough, I agree, but I'd druther not simply print a string in that case... it's practically a liscense to write non-portable code. I'd druther do something close to kill( getpid(), SIGSEGV ); in such a case. -- "Who would be fighting with the weather like this?" "Only a lunatic." "So you think D'Artagnian is involved?" --- Porthos, Athos, and Aramis. -- Wayne Throop !mcnc!rti!xyzzy!throopw