How to enable C99 mode in codewarrior version 10.6

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

How to enable C99 mode in codewarrior version 10.6

ソリューションへジャンプ
5,076件の閲覧回数
kaustubhkagalka
Contributor II

Hi,

 

I am trying to port my code to C99 mode. For this I tried

1. #pragma on C99 ;

but this comes out with warning ignoring pragma and it shoes error where I use for(int i=0,i<XX,i++) , telling ::: for loop intial declaration only allowed in C99 mode

 

2.I also tried changing the compiler command to arm-none-eabi-gcc-c99 and arm-none-eabi-gcc-std=c99, which allows me to build the project without errors when using " for(int i=0,i<XX,i++)" but shows error when I try compiling the code.For errors i am attaching the jpg.

 

 

Can someone help me to enable the C99 mode.

ラベル(1)
タグ(2)
0 件の賞賛
返信
1 解決策
3,978件の閲覧回数
trytohelp
NXP Employee
NXP Employee

Hi,

For Kinetis, 2 build tool chains are available under MCU V10.6:

      - Freescale,

      - GCC.

According to the \CW MCU v10.6\MCU\Help\PDF\MCU_Kinetis_Compiler.pdf manual for Freescale tool, the Syntax is #pragma c99 on | off | reset

For instance:

      #pragma c99 on

According to the \CW MCU v10.6\MCU\Help\PDF\MCU_Kinetis_GCC.pdf manual for GCC tool, C99 can not be used through a pragma.

Under propject properties for the language Standard you can select ISO C99 option.

The option can be define by #define C99.

For details I recommend you to:

      - check the build tool chain used (it seems to be the GCC),

      - perform a search for C99 in the corresponding compiler manual.

Hope this will help you.


Have a great day,
Pascal Irrle

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

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
3,978件の閲覧回数
kaustubhkagalka
Contributor II

Hi Pascal,

Thanks for the answer I looked up in the correct manual and found the solution. I was referring older version uptill now. :smileyplain:

Thanks!!

0 件の賞賛
返信
3,979件の閲覧回数
trytohelp
NXP Employee
NXP Employee

Hi,

For Kinetis, 2 build tool chains are available under MCU V10.6:

      - Freescale,

      - GCC.

According to the \CW MCU v10.6\MCU\Help\PDF\MCU_Kinetis_Compiler.pdf manual for Freescale tool, the Syntax is #pragma c99 on | off | reset

For instance:

      #pragma c99 on

According to the \CW MCU v10.6\MCU\Help\PDF\MCU_Kinetis_GCC.pdf manual for GCC tool, C99 can not be used through a pragma.

Under propject properties for the language Standard you can select ISO C99 option.

The option can be define by #define C99.

For details I recommend you to:

      - check the build tool chain used (it seems to be the GCC),

      - perform a search for C99 in the corresponding compiler manual.

Hope this will help you.


Have a great day,
Pascal Irrle

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

0 件の賞賛
返信