Missing Predefined C Macros

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

Missing Predefined C Macros

跳至解决方案
2,427 次查看
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 解答
950 次查看
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 回复数
951 次查看
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 项奖励
回复
950 次查看
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 项奖励
回复