Use of stdbool.h in Code Warrior for DSC (revisted)

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

Use of stdbool.h in Code Warrior for DSC (revisted)

642 Views
elvismemphis
Contributor I

There is a previous post titled: "Use of stdbool.h in Code Warrior for DSC" at this link:

Use of stdbool.h in Code Warrior for DSC 

It ended by recommending that the user add the flag "-flag slld".

I am having the same problem with bool undefined. Adding "-flag slld" does fix the problem. BUT, it also implements support for 64-bit data type (long long) which I do not need. Unless this is by-product of C99. Because, the bool data type is part of the C99 specification.

The issue is that stdbool.h includes "#include <ansi_parms.h>". ansi_parms.h has the following #defines:

#ifndef _MSL_HIWARE_COMP   /* LINE 107 */

#define _MSL_HIWARE_COMP    0
#endif

#ifndef _MSL_C99            /* LINE 151 */
#define _MSL_C99 1
#endif

Then when stdbool.h gets to line 17, it has the conditional:

#if (!_MSL_C99 && !_MSL_HIWARE_COMP)          /*- mm 030304 -*/
    #warning "MSL support for C99 is not enabled"
#else

So, _MSL_C99 is true but _MSL_HIWARE_COMP is false. This seems to cause C99 support to be disabled. So, why do I need to enable slld, long long support to fix this. Is that because long long support is intrinsically part of the C99 specification? I am working with limited flash and do not need long long support or any additional flash space that this might use. Also, where does adding -flag slld set the _MSL_HIWARE_COMP defintion to 1? Grepping the whole directory of

"C:\Freescale\CW MCU v10.7\MCU\M56800E Support\" the only definition for _MSL_HIWARE_COMP is line 107 in ansi_parms.h. So, how does -flag slld accomplish this? And, how can I get C99 support WITHOUT "long long" support?

0 Kudos
1 Reply

499 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi

We will check this problem but we need more information:

1. your CW version

2. demo code to reproduce the problem.

3. problem screenshot.

Thanks for cooperation.


Have a great day,
Jennie Zhang

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

0 Kudos