Hacker News new | ask | show | jobs
by jacquesm 3645 days ago
This is really not the case.

The C language and the standard library are distinct things. C originally did not define any values at all for booleans (true / false), but later implementations did and even in the oldest C compilers (0 == 0) would evaluate to '1', which caused the most repeated lines of C preprocessor input ever written:

#define TRUE 1 #define FALSE 0

Guarded by some #ifdefs if your compiler supported that.

Some standard library functions return nonzero on error (which can be < 0 or > 0), zero on 'success' which is not the same as true, and others (annoyingly) return 1 on 'success' or 'true' (such as the isalpha function/macro).