An interesting behaviour in printf

Doug Gwyn gwyn at smoke.BRL.MIL
Sun Mar 19 16:00:40 AEST 1989


In article <2343 at buengc.BU.EDU> bph at buengc.bu.edu (Blair P. Houghton) writes:
>In article <15938 at cup.portal.com> Tim_CDC_Roberts at cup.portal.com writes:
>>Trivia question: is the '(null)' output of printf standard or widespread?

AT&T UNIX System V Release 2.0 just printed out whatever was accidentally
pointed at.  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.



More information about the Comp.lang.c mailing list