Discarded Function Values (To Cast or Not to Cast)

Alan J Rosenthal flaps at dgp.toronto.edu
Wed Nov 29 03:56:26 AEST 1989


dhesi%cirrusl at oliveb.ATC.olivetti.com (Rahul Dhesi) writes:
>I will crudely divide standard library functions into two groups, based
>on their return value:
>
>1.   Those that return a status value
>2.   Those that return data

...
>The return value from category 2 functions can usually be safely cast
>to void...

I don't think this is a very good taxonomy.  You should distinguish functions
that return interesting data from functions that return boring data.  Functions
like strcpy() that return boring data can be safely cast to void.  Functions
like atof() that return interesting data cannot.

ajr

--
"Learning algorithms from Knuth is almost as bad as learning physics from
 Newton in the Latin original."                     -- Jeffrey Kegler



More information about the Comp.lang.c mailing list