[splint-discuss] Running Splint for Linux drivers

Vijayendra Suman vijayendra.suman at gmail.com
Thu Mar 6 03:50:30 PST 2008


Hi,

I am new to splint tool, We tried to run splint on Linux drivers.  Thanks in
advance for your appreciated help !

Is there any way to exclude the Linux kernel headers path when we try to run
splint over our driver code, I mean to say if we have any option to exclude
the linux kernel header files from getting parsed by the splint tool. I just
wanted to check driver files with the splint tool. Here is the errors i got
when I tried to run splint on my drivers.

This is the Makefile for splint:

CFLAGS += $(DEBFLAGS)
CFLAGS += -I..
CFLAGS += -I$(DEBUG_DIR_PATH)
CFLAGS += -I$(DRIVER_DIR_PATH)
CFLAGS += -I$(HW_DIR_PATH)
CFLAGS += -I$(APPS_DIR_PATH)
CFLAGS += -I$(OSDEP_PATH)
CFLAGS += -D$(RELEASE_TYPE)

SPLINTFLAGS += -I$(CFLAGS)
SPLINTFLAGS += -I/lib/modules/`uname -r`/build/include

splint:
       @$(ECHO) "Going for Splint Checking"
       @splint -weak                   \
              -gnuextensions          \
               -macrovarprefixexclude  \
              -namechecks             \
              -skip-ansi-headers      \
               -preproc                \
               -expect 100             \
               -systemdirerrors        \
               -hints                  \
              +trytorecover           \
              +posixlib               \
       $(SPLINTFLAGS) $(SRC_DIR_PATH)/slim_bus_hw.c

This is the O/P I got after running running  this

[root at localhost build]# make splint
Going for Splint Checking
Splint 3.0.1.7 --- 24 Jan 2003

Command Line: Setting -sysdirerrors redundant with current value
/lib/modules/2.6.20/build/include/asm/types.h:13:24: Parse Error:
    Suspect missing struct or union keyword: __signed__ :
    unsigned short int. Attempting to continue.
/lib/modules/2.6.20/build/include/asm/types.h:19:23: Parse Error:
    Suspect missing struct or union keyword: __signed__ :
    unsigned short int. Attempting to continue.
/lib/modules/2.6.20/build/include/asm/types.h:19:23:
    Parse Error.  Too many errors, giving up.
*** Cannot continue.
make: *** [splint] Error 1

I have used Red Hat Linux 2.6.20 kernel for the include file

-- 
Regards
Vijayendra Suman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.cs.virginia.edu/pipermail/splint-discuss/attachments/20080306/2fdb99f3/attachment-0001.html 


More information about the splint-discuss mailing list