Fix splint warnings, add splint test case

This commit is contained in:
Petteri Aimonen
2014-04-02 20:59:01 +03:00
parent 6c90e824c4
commit 99434724d0
4 changed files with 60 additions and 11 deletions

13
tests/splint/SConscript Normal file
View File

@@ -0,0 +1,13 @@
# Check the nanopb core using splint
Import('env')
p = env.WhereIs('splint')
if p:
env.Command('pb_decode.splint', '$NANOPB/pb_decode.c',
'splint -f splint/splint.rc $SOURCE 2> $TARGET')
env.Command('pb_encode.splint', '$NANOPB/pb_encode.c',
'splint -f splint/splint.rc $SOURCE 2> $TARGET')

36
tests/splint/splint.rc Normal file
View File

@@ -0,0 +1,36 @@
+checks
+partial
+matchanyintegral
+strictlib
-isoreserved # to be fixed in 0.3
-nullassign
-predboolint
-predboolptr
+ptrnegate
-switchloopbreak
+ignoresigns
-infloopsuncon
-type
# splint's memory checks don't quite work without annotations
-mustfreeonly
-compmempass
-nullret
-observertrans
-statictrans
-compdestroy
-nullpass
-nullstate
-compdef
-usereleased
-temptrans
-dependenttrans
-kepttrans
-branchstate
# These tests give false positives, compiler typically has
# better warnings for these.
-noret
-noeffect
-usedef