Declaration specifier conflict: illegal 'bool' sequence

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Declaration specifier conflict: illegal 'bool' sequence

1,096 Views
DSabol
Contributor II

Hi,

 

I am getting that error in PE_Types.h from the following line

 

typedef unsigned char bool;

 

A co worker has the same project/code as I do and does not get the error when building.  Is there some setting that would fix this?

 

I am using CodeWarrior for Coldfire V7.1  with 52277

 

Thanks

Labels (1)
0 Kudos
5 Replies

624 Views
CrasyCat
Specialist III

Hello

 

You may want to check following settings in both project:

    - Inside of Target > Language Settings >C/C++ Language, are following check boxes checked/unchecked:

         - Force C++ compilation

         - Enable C99 Extensions

 

  - Inside of Target > Language Settings >C/C++ Preprocessor, do you have something like #pragma bool on

   or are you including / defining something different?

 

CrasyCat

0 Kudos

624 Views
DSabol
Contributor II

In C/C++ language I have Force C++ Compilation checked.  Enable C99 Extensions is unchecked.

 

In C/C++ Preprocessor I have Emit #pragmas checked

 

These are the same settings as they are for the working version.

0 Kudos

624 Views
DSabol
Contributor II

If I uncheck the Force C++ compilation box, it compiles without any errors.

 

However, everyone else on my team comliles with the box checked.

 

Could there be some component that I am missing that they have?

0 Kudos

624 Views
BlackNight
NXP Employee
NXP Employee

Hello,

maybe this is unrelated, but I had in the past similer issues.

The problem there was that 'bool' was declared in other header files. Some were protected with #ifndef, some not.

The issue was that depending on the include file order, this triggered compiler errors too, similar to this one.

I hunted the problem down looking at the compiler preprocessor output, and then properly and carefully change the order of included files.

 

Hope this helps,

BK

0 Kudos

624 Views
DSabol
Contributor II

That was our first thought too....but I can't find it defined anywhere else

 

There are others errors I'm getting that I shouldn't be getting as well,

 

I am getting undefined identifier,  data type is incomplete and function call does not match.

 

I am running the same project as everyone else, from the same files, so my guess is that all the errors are the result of the same issue, I just can't figue out what it is.

0 Kudos