Re: gcc-toolchain for freescale's MC9S12X (68HCS12) ??

Florian E. Teply wrote:
Hiya folks,

as you might guess from the subject: I'm trying to find a toolchain for
freescale's hcs12 or S12X family of microcontrollers. Currently i'm
using Codewarrior on the Windows machine at work, but as i'm a tad
dissatisfied by it's lack of decent syntax-checking and have no windows
at home, i'd rather use some free compiler available for my rather
unusual platform (Linux on PowerPC). So gcc would probably be the best

Has any of you guys experience with that combination or another
suggestion (apart from buying some windows machine)??

gcc provides better syntax checking than any other compiler I have tried. However, I don't believe there is a gcc port for the 68HCS12 - if such a thing exists, it would only be as a minor partial port. But there are a couple of other ways to achieve what you want without dropping Codeworrier.

It is quite possible to use gcc for a different target as a static analysis tool. I've done that along with a commercial compiler for a target (I've forgotten which - it was a long time ago) - gcc "compiles" the program natively for the host (linking tended to fail...). It might mean a little bit of fiddling to get the right headers at the right place, and perhaps an extra header defining macros for any compiler extensions used by the real target compiler, but it can often work well. You can also use gcc to generate the makefile dependencies at the same time.

An alternative is to use a dedicated static analysis tool. The big one is PC-Lint, which is a reasonable price on Windows (but absurdly four times the price on Linux - and I doubt they support PPC Linux). The open source option is splint, which should be fine on your system.