Re:How can C Programs be so Reliable?
by mattgreenrocks on Thursday September 22, 2011 @08:40AM
(#3025834)
No, but C could use more consistent error handling semantics, rather than conflating return values and error codes. Worse still: a combination of a return code and a global error code.
[ Parent
| on HN ]
"Worse still: a combination of a return code and a global error code."
That's not the worst that exists in C :-) Let me quote a dietlibc developer from http://www.koders.com/c/fid1639C203A2255EB1FA11DC6A68D74FEB2...
/* Oh boy, this interface sucks so badly, there are no words for it.
* Not one, not two, but _three_ error signalling methods! (*h_errnop
* nonzero? return value nonzero? *RESULT zero?) The glibc goons
* really outdid themselves with this one. */And a comment written by a 13-year old proves what exactly?