Use of stdbool.h in Code Warrior for DSC

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Use of stdbool.h in Code Warrior for DSC

ソリューションへジャンプ
2,238件の閲覧回数
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 解決策
1,861件の閲覧回数
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 返答(返信)
1,862件の閲覧回数
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 件の賞賛
返信
1,861件の閲覧回数
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 件の賞賛
返信