News for hackers. Stuff that matters.
Re:How can C Programs be so Reliable? by tbrownaw on Thursday September 22, 2011 @03:21PM (#3027388)
> In case of errors (s)ome functions are returning 0. Some are returning -1.

That's not a feature of the language.

The inconsistency is a natural, expected, unavoidable result of the language forcing, er strongly encouraging, use of an unsuitable error reporting mechanism ("find some value in the range of the function's return type that isn't in the range of the function, and use it to indicate an error"). This wouldn't be an issue with exceptions or tuples / multivalue return like some languages allow.

There are no comments on this comment yet.