if (p), where p is a pointer - PLEASE READ

Doug Gwyn <gwyn> gwyn at brl-tgr.ARPA
Wed Sep 25 07:13:01 AEST 1985


> By the way, has anybody figured out how to get lint to shut up about
> the return codes for { ,s,f}printf().  I have yet to see a standard definition
> of the return code, but lint keeps giving me "value returned but not used".
> Isn't this just a tramp from doprntf?  I've had one version hand back the
> value of write (and blew away my stack) even though the return code was
> supposed to return a char* (sprintf),  (Seems it didn't like writing a
> 4k message).  This appears to be a good case for using if(sprintf(...)).

This subject has been discussed to death before.  In X3J11 and UNIX
System V, the *printf() functions return a value (# chars transmitted,
or negative on output error).  If you don't wish to test this value
(shame on you), then cast it to (void).



More information about the Comp.lang.c mailing list