我正在努力使splint与我正在进行的嵌入式项目一起工作。我想知道是否有一个示例.splintrc
选项文件,我可以添加自己的选项/配置来简化整个过程。我正在使用IAR工作台来编译和构建项目,并希望将splint与IDE集成。
答案 0 :(得分:0)
这是一个试图涵盖部分MISRA-C 2004规则的选项文件:
#-hints
#-forcehints
-linelen 120
-parenfileformat
+quiet
-booltype bool
-booltrue true
-boolfalse false
-standard
+strictlib
# the flags commented out below are switched on by default or the
# '-standard' shortcut.
+ansi89limits
#+boolops
#+casebreak
#-charint
+cppnames
+declundef
+elseifcomplete
#+evalorder
+exportheader
+exportheadervar
#+exportlocal
-externalnamelen 31
+fcnmacros
#+firstcase
#-floatdouble
+forblock
#+gnuextensions
+ifblock
#-ignorequals
#-ignoresigns
#+imptype
#+incompletetype
#+incondefs
#+initsize
-internalnamelen 31
+isoreserved
+isoreservedinternal
#-longintegral
#-longunsignedintegral
#+macroassign
#+macrofcndecl
#+macroparams
#+macroparens
#+macrostmt
-maintype
#-matchanyintegral
#-modfilesystem
#+namechecks
#+nestcomment
#+noeffect
+noparams
#+noret
+oldstyle
#+predassign
#+predboolint
+protoparammatch
#-protoparamname
+ptrarith
#+realcompare
+redecl
#+redef
-relaxquals
#-relaxtypes
+retval
#+shadow
#+shiftimplementation
#+shiftnegative
+slashslashcomment
#+stackref
#+sysunrecog
#+type
#+unreachable
#+unrecog
#+unrecogdirective
#+usedef
#+usevarargs
+whileblock
来源: http://www.cs.virginia.edu/pipermail/splint-discuss/2007-March/000923.html