casts to void

Doug Gwyn <gwyn> gwyn at brl-tgr.ARPA
Thu Aug 15 16:46:07 AEST 1985


> OK. What should my whizzbang filter do when a write fails, other than
> write an error message and quit?

The canonical UNIX tool should write a message such as "prog: write
failed" to stderr (which may be writable even though stdout has a
problem), restore terminal modes if necessary, remove temporary files,
etc. then exit with a non-zero status code (so that the invoker of the
program can detect the problem and take whatever strategic measures
are needed).

Other more specialized programs may need to take other actions opon
occurrence of an error.  The important point is to DETECT that an
error has occurred, then take appropriate steps (usually, REPORT it).



More information about the Comp.lang.c mailing list