Use of stdbool.h in Code Warrior for DSC

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

Use of stdbool.h in Code Warrior for DSC

Jump to solution
2,236 Views
spacedog
Contributor I

I want to use the _Bool type and `true`/`false` by including stdbool.h, here's my test code:

 

#pragma c99 on

#include <stdbool.h>

 

void main(void)

{

     _Bool b = true;

    b = false;

}

 

But I get the following error:  #warning "MSL support for C99 is not enabled"

 

And neither `true` or `false` is defined. `_Bool` is defined and works correctly so I'm confused as to what's happening. How do I enable C99 mode, get the correct defines and get rid of the warning?

 

I know that, since _Bool works correctly, I can just define `true` and `false` myself but I want to understand what the warning means and what other problems it may cause.

 

I'm using CodeWarrior 10.6 build 140329

Labels (1)
Tags (2)
0 Kudos
Reply
1 Solution
1,859 Views
TICS_Fiona
NXP Employee
NXP Employee

Hello Colin

Please add the compiler option –flag slld to remove this compiler warning.

To add the option, pleases select ‘Project’ menu ->Poperties > C/C++Build > Settings > DSC Compiler > ‘Language’ Panel >Other Flags

option.png

Best Regards

Fiona Kuang

Technical Information & Commercial Support

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
Reply
2 Replies
1,860 Views
TICS_Fiona
NXP Employee
NXP Employee

Hello Colin

Please add the compiler option –flag slld to remove this compiler warning.

To add the option, pleases select ‘Project’ menu ->Poperties > C/C++Build > Settings > DSC Compiler > ‘Language’ Panel >Other Flags

option.png

Best Regards

Fiona Kuang

Technical Information & Commercial Support

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
1,859 Views
johnlwinters
NXP Employee
NXP Employee

If this issue is still slowing your progress, please add your sample project illustrating your issue by zipping up the entire project.

Or, if it is easier, please state the simple specification for a sample project that we can create now for the community to address this.

0 Kudos
Reply