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
Solved! Go to Solution.
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
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
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