casts to (void) [considered harmful]

robert thau thau at h-sc1.UUCP
Fri Aug 2 14:42:46 AEST 1985


>     The use of (void) also points out the fact that the programmer
>     *intentionally* is ignoring the return value of the function.
>     At the very least it is useful documentation.
> 
>     KEITH F. PILOTTI -- TeleSoft         (619) 457-2700 x172

*** Flame warning ***
printf() is invariably used as a formatted-output statement,
not as a value-returning function.  A "(void)" which makes this fact explicit
not only adds no information to a program, but obscures things by hiding
the actual code behind a forest of (face it, folks) lint directives.  What's
worse, there are far too many people who believe that "(void)",
"/*ARGSUSED*/" and the ilk are documentation rather than clutter;
their code is generally bereft of comments which *explain* data structures,
*elucidate* obscure algorithms, and *clarify* code.  DOWN WITH LINT SALAD!!!
*** Flameout ***
-- 
Robert Thau			        \
Keeper of the *FLAME*			))
rst at tardis.ARPA			       ( (
h-sc1%thau at harvard.ARPA			\\



More information about the Comp.lang.c mailing list