NOTICE: The Processors Wiki will End-of-Life in December of 2020. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.

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'

E2e.jpg {{
  1. switchcategory:MultiCore=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article Invalid combination of type specifiers and Bool here.

Keystone=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article Invalid combination of type specifiers and Bool here.

C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article Invalid combination of type specifiers and Bool here. DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article Invalid combination of type specifiers and Bool here. MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article Invalid combination of type specifiers and Bool here. OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article Invalid combination of type specifiers and Bool here. OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article Invalid combination of type specifiers and Bool here. MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article Invalid combination of type specifiers and Bool here. For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article Invalid combination of type specifiers and Bool here.

}}

Hyperlink blue.png Links

Amplifiers & Linear
Audio
Broadband RF/IF & Digital Radio
Clocks & Timers
Data Converters

DLP & MEMS
High-Reliability
Interface
Logic
Power Management

Processors

Switches & Multiplexers
Temperature Sensors & Control ICs
Wireless Connectivity