Please note as of Wednesday, August 15th, 2018 this wiki has been set to read only. If you are a TI Employee and require Edit ability please contact x0211426 from the company directory.

Invalid combination of type specifiers and Bool

From Texas Instruments Wiki
Jump to: navigation, search

In the newer versions of the compiler, an error may be emitted regarding the definition of the following:

  • The _Bool type
  • The bool typedef or macro
  • The true and false macros
  • The __bool_true_false_are_defined macro

To fix this issue, remove the macro definitions and typedefs listed above and replace the code with:

#include <stdbool.h>

Prior to support for the standard header <stdbool.h>, users often manually defined the above identifiers. When not guarded properly, this added code will cause errors at compile-time in the default (relaxed) language mode. The error will take a form such as:

"bool_fail.c", line 1: error: invalid combination of type specifiers

This is because _Bool is defined internally, and the compiler is reading a single type called 'unsigned int _Bool' rather than a typedef of '_Bool' to the type 'unsigned int'