[splint-discuss] cross-referencing tool

Wenzel, Bodo Wenzel at bbr-vt.de
Tue Jun 30 23:50:38 PDT 2009


Hi Mehmet,

> Would you please send me an example makefile ?
Well, I can't send you a complete Makefile because it'll hide the important parts. Here is an excerpt of a working example:

--- 8>< snip -----------------------------------------

LD = avr-gcc
LDFLAGS = -mmcu=at90usb1287 -Wall -Wextra -Werror -Wl,-u,vfprintf -Wl,-u,vfscanf
LIBS = -lprintf_flt -lscanf_flt -lm

LINT = splint
LINTFLAGS = +quiet +checks +top-use -paren-file-format -preproc \
 +slash-slash-comment +all-macros +all-block

MODULES = adc [...parts left out...] main [...parts left out...] watchdog

OBJECTS = $(MODULES:%=%.o)
SOURCES = $(MODULES:%=%.c)

application.elf: $(OBJECTS)
	$(LD) $(LDFLAGS) $^ $(LIBS) -Wl,-Map=$(@:%.elf=%.map) -o $@
	$(LINT) $(LINTFLAGS) $(SOURCES)

--- snap ><8 -----------------------------------------

This is for an application running on an AVR, compiled and linked by WinAVR on Win2K. I'm using Eclipse as an IDE, but I can use the DOS shell as well to run Make. Some notes:

- All modules are compiled separately, as usual. At that time there are no Splint calls. This is not shown because you should know how to do this.

- The linker runs _before_ Splint to make sure that the application is correct. (As far as GCC can say; but GCC is strong!) If the link stage fails, Make aborts the build and Splint will not even be run.

- The option "-paren-file-format" makes Splint's messages detectable by Eclipse.

- The option "-preproc" disables warnings about missing system header files.

- You don't need to list the application's header files because Splint will read them through the #include "..." directive.

Of course Splint needs to be installed so that it can be run right from the command line. Here is an excerpt of my environment variables:

--- 8>< snip -----------------------------------------

LARCH_PATH=C:\Programme\Tools\splint-3.1.1\lib;.
Path=[...cut...];C:\Programme\Tools[...cut...];D:\WinAVR\bin

--- snap ><8 -----------------------------------------

Splint's executable file "splint.exe" is copied into the directory "C:\Programme\Tools", but all other files are in the directory "C:\Programme\Tools\splint-3.1.1" to keep things simple.

HTH, Bodo


Mit freundlichen Grüßen

i. A. Bodo Wenzel
- Entwicklung Software -

-- 
BBR - Baudis Bergmann Rösch
Verkehrstechnik GmbH
Pillaustraße 1e
D - 38126 Braunschweig

T: +49.531.27300-766
F: +49.531.27300-999
@: wenzel at bbr-vt.de
W: http://www.bbr-vt.de

Registergericht:
AG Braunschweig  HRB 3037

Geschäftsführer:
Dipl.-Ing. Arne Baudis
Dipl.-Ing. Thomas Bergmann
Dipl.-Ing. Frank-Michael Rösch

USt.-ID-Nr.:
DE 114 877 881



More information about the splint-discuss mailing list