LWN.net Logo

GCC Explorer - an interactive take on compilation

GCC Explorer - an interactive take on compilation

Posted Jun 3, 2012 16:29 UTC (Sun) by lacos (subscriber, #70616)
In reply to: GCC Explorer - an interactive take on compilation by cmccabe
Parent article: GCC Explorer - an interactive take on compilation

most people opt not to check the return value of writing to stdout, because they just don't care. There's nothing really wrong with that.

I disagree. stdout doesn't have to refer to a tty. It may have been redirected to a regular file.

I'm not arguing that every single fprintf() retval should be checked. But at least fflush()'s retval and the error indicator of the output stream should be checked (with ferror()) at reasonable places.


(Log in to post comments)

GCC Explorer - an interactive take on compilation

Posted Jun 6, 2012 9:26 UTC (Wed) by mpr22 (subscriber, #60784) [Link]

I disagree. stdout doesn't have to refer to a tty. It may have been redirected to a regular file.

That doesn't change the (lack of) importance to the program of whether printf("Now frobbing frob %d of %d (%s)\n", frob->num, total_frobs, frob->name); succeeds or fails.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds