Use of stdbool.h in Code Warrior for DSC

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Use of stdbool.h in Code Warrior for DSC

跳至解决方案
2,645 次查看
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

标签 (1)
标记 (2)
0 项奖励
回复
1 解答
2,268 次查看
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 项奖励
回复
2 回复数
2,269 次查看
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 项奖励
回复
2,268 次查看
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 项奖励
回复