[splint-discuss] SPLINT sysmac.h error
Ludolf Holzheid
lholzheid at bihl-wiedemann.de
Mon Jul 16 12:57:40 PDT 2007
On Mon, 2007-07-16 20:46:46 +0100, Brian Quinlan wrote:
> [..]
> Hi Asim & Ludolf,
> If sfrb, sfrw or indeed anything else non-standard is causing parse
> problems for splint, you may find that you can usefully redefine them
> via the splint -D command-line option.
Hi Brian,
this was my first idea too, but unfortunately IAR declares 'special
function registers' for microcontrollers with a totally non-standard
syntax like that:
#define WDTCTL_ (0x0120) /* Watchdog Timer Control */
sfrw WDTCTL = WDTCTL_;
This means "using the symbol WDTCTL, you will access, the 16-bit wide
'watchdog timer control' register at address 0x0120".
A clean ISO/ANSI-C code replacement to be presented to splint would be
e.g.:
#if !defined MAIN_MODULE
extern
#endif
unsigned short WDCTL;
Moreover, if you check IAR code with splint, you'll need a header with
the declaration of the 'intrinsic functions' (EINT(), NOP(), etc.) anyway.
Ludolf
--
---------------------------------------------------------------
Ludolf Holzheid Tel: +49 621 339960
Bihl+Wiedemann GmbH Fax: +49 621 3392239
Floßwörthstraße 41 e-mail: lholzheid at bihl-wiedemann.de
D-68199 Mannheim, Germany
---------------------------------------------------------------
More information about the splint-discuss
mailing list