Either I didn't searched well or this question is obvious.
In c
, the main function returns what You want. But since Posix gives the example, 0 is for success and other values are for fail (mostly positive values in Linux).
Based on this assumption, I have seen a practive where all other functions in the code have the same behaviour.
- Pros:
- practical because you can return the result of your call directly as the result of your main
- Cons:
- 0 becomes OK, 1 becomes KO.
I am sure it is not good, but I have here 2 million lines based on that.
Is that common ? Does it have a name ?