Path: utzoo!attcan!uunet!husc6!spdcc!ima!haddock!karl From: karl@haddock.ima.isc.com (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: Why use (void) func() ? Message-ID: <18179@haddock.ima.isc.com> Date: 24 Sep 90 23:31:20 GMT References: <586@dptechno.UUCP> Reply-To: karl@kelp.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Cambridge, MA 02138-5302 Lines: 11 In article <586@dptechno.UUCP> dave@dptechno.uucp (Dave Lee) writes: >Why should I go to the extra trouble to [explicitly cast to void]? To distinguish between "This call might fail, but I don't know what I should do about it" (uncast) and "This call might fail, but the appropriate recovery operation is a NOP" (cast). An example of the former is most programs' use of putchar() or printf(). An example of the latter is unlink(t) in a cleanup routine where t is a temp file that may or may not exist at this point, or the fprintf(stderr, ...) issued from a panic routine just before exiting. Karl W. Z. Heuer (karl@kelp.ima.isc.com or ima!kelp!karl), The Walking Lint