4 ms·
Not dismissing anything you said but bool isn't C89 right ? Back ~6 years ago when I worked in embedded C89, bool was just a #define true (1==1), #define false
by coumbaya 3y ago
Not dismissing anything you said but bool isn't C89 right ?
Back ~6 years ago when I worked in embedded C89, bool was just a #define true (1==1), #define false (0==1) so I guess it makes sense it isn't in the lib ?
- eqvinox 3y agoIndeed, bool (or _Bool) was added in C99, hence my pointing out it not being used… it's not in C89. It matters because the return value sense is different; an "int" return for a status-ish thing in a modern library generally means 0 for success, nonzero for error codes. "bool" is the other way around, 0 for failure-y. In this case it's a status retrieval function so it's pretty clear that it's intended as a boolean but it'd still be better to actually make it bool.
- coumbaya 3y agoAh, I get it now, thx.