Re:Show HN: A pure C89 implementation of Go channels, with b...
by coumbaya on Wednesday December 13, 2023 @03:09PM
(#38633481)
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 ?
[ Parent
| on HN ]
Re:Show HN: A pure C89 implementation of Go channels, with b...
by eqvinox on Wednesday December 13, 2023 @03:14PM
(#38633553)
Indeed, 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.