Why use (void) func() ?

Dan Bernstein brnstnd at kramden.acf.nyu.edu
Tue Sep 25 06:18:04 AEST 1990


I put in the (void) to remind myself later that I simply do not care
about the return value of foo. When I leave something like printf()
without a (void), I'm reminding myself that I may or may not want to
check the return value. This gain in readability (using a convention
that lint also supports) justifies taking advantage of the feature.

---Dan



More information about the Comp.lang.c mailing list