Re: gcc-toolchain for freescale's MC9S12X (68HCS12) ??
- From: Grant Edwards <grante@xxxxxxxx>
- Date: Thu, 29 May 2008 12:03:20 -0500
On 2008-05-29, Florian E. Teply <onlinefloh@xxxxxxxxxxxxxxxx> wrote:
And -- i just checked -- the gcc man page lists in the "machine dependent
options" section the options -m68hc12 and -m68hcs12 in version 4.3.0.
I'll probably try and get this to work, but as said: using gcc as a mere
syntax checker would already be a start.
Gcc is a single-target design: you have to build a separate gcc
installation for each target architecture. IOW, you can't
switch from IA32 to HC12 target architecture by merely changing
the command line arguments passed to a single gcc binary.
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.
Thanks, will have a look at splint.
In my experience splint is useless for real world work. It'll
warn you about code like this:
uint8_t b;
b = 1;
Splint is unhappy because b is 8 bits wide and "1" is 16 or 32
bits wide (depending on your target), and the assignment is
loosing bits. If you turn that warning off, then you _won't_
get warned about code like this:
uint32_t u;
uint8_t b;
b = 123456789L;
b = u;
The only solution is to completely cover your code with
type-casts. The result is code without splint warnings, but
it's completely impossible to read/maintain.
I looked into trying to fix up splint to make it useful for
real work, but gave up after looking at the internals. The
"owners" of splint acknowledged on the splint mailing list that
splint was intended for language research and not for use with
real programs.
--
Grant Edwards grante Yow! Is this going to
at involve RAW human ecstasy?
visi.com
.
- References:
- gcc-toolchain for freescale's MC9S12X (68HCS12) ??
- From: Florian E. Teply
- Re: gcc-toolchain for freescale's MC9S12X (68HCS12) ??
- From: David Brown
- Re: gcc-toolchain for freescale's MC9S12X (68HCS12) ??
- From: Florian E. Teply
- gcc-toolchain for freescale's MC9S12X (68HCS12) ??
- Prev by Date: Re: gcc-toolchain for freescale's MC9S12X (68HCS12) ??
- Next by Date: What is PWM input with very high resolution?
- Previous by thread: Re: gcc-toolchain for freescale's MC9S12X (68HCS12) ??
- Next by thread: Re: gcc-toolchain for freescale's MC9S12X (68HCS12) ??
- Index(es):
Relevant Pages
|