[splint-discuss] SPLINT sysmac.h error

Brian Quinlan brian.quinlan at iolfree.ie
Mon Jul 16 12:46:46 PDT 2007


On Mon, 2007-07-16 at 19:34 +0200, Ludolf Holzheid wrote: 
> On Mon, 2007-07-16 16:32:59 +0100, Asim Zaka wrote:
> > <html>
> > <body>
> > Hi All,<br><br>
> > I am putting my C code through SPlint for refining it using IAR C
> > compiler for H8 microprocessors. I get the following errors:<br><br>
> > <font face="Courier New, Courier">splint.exe -preproc -linelen 600
> > -DH8_38327 -DCLOCK_16MHZ -D_ISSUE -I./h/ -I\inc&nbsp;
> > [..]
> > Splint 3.0.1.6 --- 11 Feb 2002<br><br>
> > &nbsp;&nbsp; In file included from
> > \\fx1112\compilers\h8300\v4_20c\inc\string.h(13),<br>
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
> > from ./c/magtampermgr.c(26)<br>
> > \\fx1112\compilers\h8300\v4_20c\inc\sysmac.h(52,23): syntax error -
> > missing right operand<br>
> 
> Hi Asim,
> 
> you'll never get the IAR headers parsed by an ISO/ANSI-C parser. It
> will choke at least at the sfrb and sfrw statements.
> 
> For an H8 project I used splint with, I wrote my own versions of the
> offending headers and put them in a separate directory. I've put this
> directory on the top of the list of include directories for splint
> (i.e. first -I flag) in order to have them parsed instead of the IAR
> ones.
> 
> Of course, the compiler still used the original headers.
> 
> HTH,
> 
> Ludolf
> 
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. A few examples:

 -Dsfrb="" will tell splint's preprocessor to define sfrb to be the
empty string.

-Dsfrb="unsigned char" will tell splint to treat sfrb as an unsigned
character.

-Dsfrb'('w,x,y,z')'="" might be more appropriate if sfrb takes arguments

I'm not familiar with the IAR compiler, so I don't know if sfrb & sfrw
can safely be ignored by splint, or whether redefining them will "fool"
splint appropriately.

Bye,
Brian




More information about the splint-discuss mailing list