Missing Predefined C Macros

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

Missing Predefined C Macros

Jump to solution
1,945 Views
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

Labels (1)
0 Kudos
Reply
1 Solution
468 Views
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

 

View solution in original post

0 Kudos
Reply
2 Replies
469 Views
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 Kudos
Reply
468 Views
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 Kudos
Reply