From: Dale Weiler Date: Fri, 28 Dec 2012 12:29:46 +0000 (+0000) Subject: Added splint.sh (a progressive way to fix some possible bugs) X-Git-Tag: before-library~457 X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=commitdiff_plain;h=f58b4a6cd98d84589efc8b8ebb6bcbef2aa2b12b Added splint.sh (a progressive way to fix some possible bugs) --- diff --git a/ir.h b/ir.h index 05b7447..9f8e1fa 100644 --- a/ir.h +++ b/ir.h @@ -22,7 +22,7 @@ */ #ifndef GMQCC_IR_HDR #define GMQCC_IR_HDR - +#include "gmqcc.h" /* ir_value */ typedef struct diff --git a/splint.sh b/splint.sh new file mode 100755 index 0000000..fcce1b4 --- /dev/null +++ b/splint.sh @@ -0,0 +1,76 @@ +#!/bin/sh + +#these are stupid flags ... i.e to inhibit warnings that are just stupid +FLAGS_STUPID="\ + -redef \ + -noeffect \ + -nullderef \ + -usedef \ + -type \ + -mustfreeonly \ + -nullstate \ + -varuse \ + -mustfreefresh \ + -compdestroy \ + -compmempass \ + -nullpass \ + -onlytrans \ + -predboolint \ + -boolops \ + -exportlocal \ + -retvalint \ + -nullret \ + -predboolothers \ + -globstate \ + -dependenttrans \ + -branchstate \ + -compdef \ + -temptrans \ + -usereleased \ + -warnposix" + +#flags that have no place anywhere else +#mostly stupid +FLAGS_OTHERS="\ + -shiftimplementation \ + +charindex \ + -kepttrans \ + -unqualifiedtrans \ + +matchanyintegral \ + -bufferoverflowhigh \ + +voidabstract" + +#these are flags that MAYBE shouldn't be required +# -nullassign should be surpressed in code with /*@null*/ +# (although that might be odd?) +FLAGS_MAYBE="\ + -nullassign \ + -unrecog \ + -casebreak \ + -retvalbool \ + -retvalother \ + -mayaliasunique \ + -realcompare \ + -observertrans \ + -noret \ + -shiftnegative \ + -exitarg \ + -freshtrans \ + -abstract \ + -statictrans" + +#these are flags that shouldn't be required. I.e tofix in code so that +#these don't need to be here to onhibit the warning +# remove one flag from here at a time while fixing the code so that +FLAGS_TOFIX="\ + -boolcompare \ + -formatconst \ + -unreachable \ + -incondefs \ + -initallelements \ + -macroredef \ + -castfcnptr \ + -evalorder" + + +splint $FLAGS_STUPID $FLAGS_MAYBE $FLAGS_TOFIX $FLAGS_OTHERS *.c *.h