I am reviewing coding guidelines for C and we still have the guideline to typedef uint8_t
for booleans. I work for a company in the automotive industry, therefore doing embedded software and usually working with Renesas micro-processors alongside GreenHills compilers.
I think that since C99 has been out there for so many years, the type definition is redundant and I would expect all compilers for modern platforms to support _Bool
. So, is it still worth having the typedef
?
Bonus question: I am trying to put together some guidelines for C++. I have a relatively limited background using C++, but again my opinion is that a typedef
for bool
should not be at all beneficial. Should we use the fundamental C++ bool
type or is there any reason why we should use a custom typedef
ed T_BOOL instead?