Re:The worst possible Hello World program
by colinhowe on Sunday April 03, 2011 @03:21AM
(#2402056)
The "best" is way overengineered. I doubt this error-handling will even work. If the program fails to print "hello world" using puts then it is very likely to fail on fprintf to stderr.
[ Parent
| on HN ]
Only if both stdout and stderr are unwritable. If stdout is unwritable but stderr is writable, then writing to stderr should work.
If they're both not writable, or stderr is writable but writing fails anyway, there's nothing we can do about it anyway, but that does not make it any less proper to try.