casts to void
Mark Purtill
Purtill at MIT-MULTICS.ARPA
Wed Aug 7 10:10:00 AEST 1985
<Fnord>
>The printf() function CAN FAIL and if you don't test for it,
>Murphy says that it WILL fail, under the worst possible
>circumstances (e.g., while updating YOUR pay record).
>Instead of looking for ways to avoid testing printf return,
>how about making your code more robust.
Come on. What are you going to do about it if printf fails? Especially
if you know you're writing to the terminal, in which case you can't
write an error message, either. You want us to write:
main( ) {
if( printf( "Hello, world\n") < 0) {
exit( -1) ; /* Ooops, can't write to terminal... */
}
}
Personally, I think there ought to be a standard way to tell all or some
of the library functions that if they get an error, they should just
print an error message and die, 'cause usually that's all I'm going to
do anyway (and usually won't.)
Mark
^.-.^ Purtill at MIT-MULTICS.ARPA **Insert favorite disclaimer here**
((")) 2-032 MIT Cambrige MA 02139
More information about the Comp.lang.c
mailing list