Missing Predefined C Macros

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

Missing Predefined C Macros

ソリューションへジャンプ
2,434件の閲覧回数
pgo
Senior Contributor V

I'm trying to work around some version specific bugs in the HCS08 compiler.  That is, some bugs that were fixed after a certain version.  I want to implement some work-arounds but only on the earlier compiler versions.

 

I was intending to use the __CWCC__  macro that is meant to have the version number of the compiler.  Unfortunately this macro appears to be only defined for the Coldfire compiler. (Is this a bug?)

 

Can anyone suggest another method of determining the compiler version?

 

bye

ラベル(1)
0 件の賞賛
返信
1 解決策
957件の閲覧回数
stanish
NXP Employee
NXP Employee

Hello pgo,

 

HC(s)08 compiler generates several macros you can use for this purposes e.g.:

 

__VERSION__ 5029

__VERSION_STR__ "V-5.0.29"

__MWERKS__ 1

...

 

For complete list of compiler generated macros you can add option -Ldf=predef.h into Compiler Arguments (ALT+F7 -> "Compiler for HC08" -> "Command Line Arguments") After make the file predef.h includes all these macros. I'd suggest you to see the "Compiler_HC08.pdf", section "Compiler Predefined Macros" for more info. 

 

 

Stanish

 

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
958件の閲覧回数
stanish
NXP Employee
NXP Employee

Hello pgo,

 

HC(s)08 compiler generates several macros you can use for this purposes e.g.:

 

__VERSION__ 5029

__VERSION_STR__ "V-5.0.29"

__MWERKS__ 1

...

 

For complete list of compiler generated macros you can add option -Ldf=predef.h into Compiler Arguments (ALT+F7 -> "Compiler for HC08" -> "Command Line Arguments") After make the file predef.h includes all these macros. I'd suggest you to see the "Compiler_HC08.pdf", section "Compiler Predefined Macros" for more info. 

 

 

Stanish

 

0 件の賞賛
返信
957件の閲覧回数
pgo
Senior Contributor V

Thanks Stanish,

 

I did a search on the help system but it didn't show these defines in the section describing the other defines.  The do appear in the HCS08 specific section!

 

The Codewarrior documentation is very fragmented!

 

bye

 

 

0 件の賞賛
返信