I'm getting a warning "enumeration type mixed with another type" with the following line of code.
typedef enum { FALSE = 0, TRUE = !FALSE } bool; bool bResult; bool bAAA; bool bBBB; bResult = bAAA && bBBB; // <-- warning bResult = (bAAA == TRUE) && (bBBB == TRUE); // <-- same results
Any suggestions?
typedef enum { FALSE = 0, // Fine TRUE = !FALSE // Risky } bool;
The 'C' language treats 0 as "false", but any non-zero value as "true"
Therefore beware of making any direct comparison to 'TRUE'...
c-faq.com/.../index.html