# Make sure .lclintrc files are not used so test results do not
# depend on local settings.
LCLINTRN = $(LCLINTP) -nof -hints -booltype "bool"
-LCLINTR = $(LCLINTRN) -exportlocal +debugfcnconstraint
+LCLINTR = $(LCLINTRN) -exportlocal +debugfcnconstraint
UNITTESTS = help sizeoftest bufferTest simplebufferConstraintTests moreBufferTests globalbufferannotation maxset strchr for abstptr abstract alias alttypes ansireserved argorder args blocks break cases cast \
charlit clauses commentchar compdestroy constannot controldepth csyntax czechnames czechoslovaknames deadparam \
decl enum exports external fields fileio flags forbody format freearray funcpointer glob globals impabstract \
- init inparam internal iter keep libs linked lintcomments list macros macrosef merge mergestate metastate modifies \
- modtest moduncon mongoincludes mystrncat noeffect null nullret nullassign observer oldstyle \
+ init inparam internal iter keep libs linked lintcomments list macros macrosef merge \
+metastate modifies \
+ modtest moduncon mongoincludes mystrncat noeffect null observer oldstyle \
outglob outparam preds prefixes \
printflike rc refcounts release repexpose returned sharing slovaknames specclauses special stack \
- staticarray strings structassign tainted typequals ud ulstypes union unreachable unused ullint void warnuse \
+ staticarray strings structassign \
+typequals ud ulstypes union unreachable unused ullint void \
tests2.2 tests2.2a tests2.4 tests2.5
+#drl removed the following tests
+#tainted mergestate nullret nullassign warnuse \
+
+
UNITEXPECTS = $(addsuffix .expect, $(UNITTESTS))
INTEGTESTS = db1 db2 db3
GREP = grep
DIFF = diff
-CLEANOUTPUT = $(GREP) -v "LCLint 3." | $(GREP) -v "make -e" | $(GREP) -v "make\[" | $(GREP) -v "lclint -nof" | $(GREP) -v "make -e"
+CLEANOUTPUT = $(GREP) -v "LCLint 3." | $(GREP) -v "make -e" | $(GREP) -v "make\[" | $(GREP) -v "lclint -nof" | $(GREP) -v "make -e" | $(GREP) -v $(LCLINT)
### not real .c
$(LCLINTRN) compdestroy.c +strict +partial -exportheader -expect 3
constannot:
- ${LCLINTRN} constannot.c +arraybounds -exportlocal -expect 2
+ ${LCLINTRN} constannot.c +arraybounds -exportlocal -expect 2
csyntax:
$(LCLINTR) +quiet -incondefs csyntax.c -expect 1
$(LCLINTR) mongoincludes.c -includenest 5 -expect 0
mystrncat:
- $(LCLINTR) mystrncat.c +arraybounds +arrayboundsread -expect 4
+ $(LCLINTR) mystrncat.c +arraybounds +arrayboundsread -expect 4
noeffect:
${LCLINT} noeffect.c +allmacros +checks -expect 3
sizeoftest:
@cd sizeoftest; \
- $(LCLINTR) +arraybounds +arrayboundsread sizeof.c
+ $(LCLINTR) +arraybounds +arrayboundsread sizeof.c
bufferTest:
@cd bufferTest; \
- $(LCLINTR) +arraybounds +arrayboundsread test4.c test6.c
+ $(LCLINTR) +arraybounds +arrayboundsread test4.c test6.c
simplebufferConstraintTests:
@cd simplebufferConstraintTests; \
- $(LCLINTR) +arraybounds +arrayboundsread m.c sizeof.c test3.c test7.c
+ $(LCLINTR) +arraybounds +arrayboundsread m.c sizeof.c test3.c test7.c
moreBufferTests:
@cd moreBufferTests; \
- $(LCLINTR) +arraybounds +arrayboundsread +orconstraint unrecogCall.c strrchr.c initialization.c simplifyTest.c strncatNotReallyGood.c strncatReallyGood.c
+ $(LCLINTR) +arraybounds +arrayboundsread unrecogCall.c strrchr.c initialization.c simplifyTest.c strncatNotReallyGood.c strncatReallyGood.c
maxset:
@cd maxset; \
globalbufferannotation:
@cd globalbufferannotation; \
- $(LCLINTR) +arraybounds +arrayboundsread globalvariable.c
+ $(LCLINTR) +arraybounds +arrayboundsread globalvariable.c
strchr:
@cd strchr; \
for:
@cd for; \
- $(LCLINTR) +arraybounds +arrayboundsread for.c
+ $(LCLINTR) +arraybounds +arrayboundsread for.c
tests2.5:
setenv LCLINT '$(LCLINTRN)'; cd tests2.5 ; $(MAKE) -e
test4.c: (in function t)
test4.c:6:3: Variable g used before definition
test4.c:6:3: Possible out-of-bounds store. Unable to resolve constraint:
- requires: : maxSet ((g @ test4.c:6:3 ) ) >= ( 100 )
+ requires maxSet(g @ test4.c:6:3) >= 100
needed to satisfy precondition:
- requires: : maxSet ((g @ test4.c:6:3 ) ) >= ( 100 )
+ requires maxSet(g @ test4.c:6:3) >= 100
test6.c:2:6: Function t defined more than once
test4.c:15:1: Previous definition of t
test6.c: (in function t)
test6.c:5:4: Variable g used before definition
test6.c:6:3: Possible out-of-bounds store. Unable to resolve constraint:
- requires: : maxSet ((g @ test6.c:5:4 ) ) >= ( 1 )
+ requires maxSet(g @ test6.c:5:4) >= 1
needed to satisfy precondition:
- requires: : maxSet ((g @ test6.c:6:3 ) ) >= ( 0 )
+ requires maxSet(g @ test6.c:6:3) >= 0
test6.c:6:10: Possible out-of-bounds read. Unable to resolve constraint:
- requires: : maxRead ((g @ test6.c:5:4 ) ) >= ( 2 )
+ requires maxRead(g @ test6.c:5:4) >= 2
needed to satisfy precondition:
- requires: : maxRead ((g @ test6.c:6:10 ) ) >= ( 1 )
+ requires maxRead(g @ test6.c:6:10) >= 1
Finished LCLint checking --- 6 code errors found
test4.c: (in function t)
test4.c:6:3: Variable g used before definition
test4.c:6:3: Possible out-of-bounds store. Unable to resolve constraint:
- requires: : maxSet ((g @ test4.c:6:3 ) ) >= ( 100 )
+ requires maxSet(g @ test4.c:6:3) >= 100
needed to satisfy precondition:
- requires: : maxSet ((g @ test4.c:6:3 ) ) >= ( 100 )
+ requires maxSet(g @ test4.c:6:3) >= 100
test6.c:2:6: Function t defined more than once
test4.c:15:1: Previous definition of t
test6.c: (in function t)
test6.c:5:4: Variable g used before definition
test6.c:6:3: Possible out-of-bounds store. Unable to resolve constraint:
- requires: : maxSet ((g @ test6.c:5:4 ) ) >= ( 1 )
+ requires maxSet(g @ test6.c:5:4) >= 1
needed to satisfy precondition:
- requires: : maxSet ((g @ test6.c:6:3 ) ) >= ( 0 )
+ requires maxSet(g @ test6.c:6:3) >= 0
test6.c:6:10: Possible out-of-bounds read. Unable to resolve constraint:
- requires: : maxRead ((g @ test6.c:5:4 ) ) >= ( 2 )
+ requires maxRead(g @ test6.c:5:4) >= 2
needed to satisfy precondition:
- requires: : maxRead ((g @ test6.c:6:10 ) ) >= ( 1 )
+ requires maxRead(g @ test6.c:6:10) >= 1
Finished LCLint checking --- 6 code errors found
constannot.c: (in function foo2)
constannot.c:11:3: Possible out-of-bounds store. Unable to resolve constraint:
- requires: : maxSet ((str @ constannot.c:11:3 ) ) >= ( 20 )
+ requires maxSet(str @ constannot.c:11:3) >= 20
needed to satisfy precondition:
- requires: : maxSet ((str @ constannot.c:11:3 ) ) >= ( 20 )
+ requires maxSet(str @ constannot.c:11:3) >= 20
constannot.c: (in function foo3)
constannot.c:20:3: Possible out-of-bounds store. Unable to resolve constraint:
- requires: : (<const int=20> ) <= ( 19 )
+ requires <const int=20> <= 19
needed to satisfy precondition:
- requires: : maxSet ((buf @ constannot.c:20:8 ) ) >= (<const int=20> )
- derived from foo precondition: requires: :
- maxSet ((<parameter 1> ) ) >= (<const int=20> )
+ requires maxSet(buf @ constannot.c:20:8) >= <const int=20>
+ derived from foo precondition: requires maxSet(<parameter 1>) >= <const
+ int=20>
Finished LCLint checking --- 2 code errors found, as expected
for.c: (in function f)
for.c:13:5: Possible out-of-bounds store. Unable to resolve constraint:
- requires: : (i @ for.c:13:7 ) <= ( 10 )
+ requires i @ for.c:13:7 <= 10
needed to satisfy precondition:
- requires: : maxSet ((t @ for.c:13:5 ) ) >= (i @ for.c:13:7 )
+ requires maxSet(t @ for.c:13:5) >= i @ for.c:13:7
Finished LCLint checking --- 1 code error found
maxsetnoannotations.c: (in function noancopy)
maxsetnoannotations.c:2:3: Possible out-of-bounds store. Unable to resolve
constraint:
- requires: : maxSet ((a @ maxsetnoannotations.c:2:11 ) ) >= maxRead ((b @
- maxsetnoannotations.c:2:13 ) )
+ requires maxSet(a @ maxsetnoannotations.c:2:11) >= maxRead(b @
+ maxsetnoannotations.c:2:13)
needed to satisfy precondition:
- requires: : maxSet ((a @ maxsetnoannotations.c:2:11 ) ) >= maxRead ((b @
- maxsetnoannotations.c:2:13 ) )
- derived from strcpy precondition: requires: :
- maxSet ((<parameter 1> ) ) >= maxRead ((<parameter 2> ) )
+ requires maxSet(a @ maxsetnoannotations.c:2:11) >= maxRead(b @
+ maxsetnoannotations.c:2:13)
+ derived from strcpy precondition: requires maxSet(<parameter 1>) >=
+ maxRead(<parameter 2>)
Finished LCLint checking --- 1 code error found, as expected
initialization.c:5:10: Variable g declared but not used
initialization.c:8:3: Possible out-of-bounds store. Unable to resolve
constraint:
- requires: : maxSet ((d @ initialization.c:3:14 ) ) >= ( 2 )
+ requires maxSet(d @ initialization.c:3:14) >= 2
needed to satisfy precondition:
- requires: : maxSet ((f @ initialization.c:8:3 ) ) >= ( 2 )
+ requires maxSet(f @ initialization.c:8:3) >= 2
initialization.c:5:14: Possible out-of-bounds read. Unable to resolve
constraint:
- requires: : maxRead ((d @ initialization.c:3:14 ) ) >= ( 22 )
+ requires maxRead(d @ initialization.c:3:14) >= 22
needed to satisfy precondition:
- requires: : maxRead ((e @ initialization.c:5:14 ) ) >= ( 22 )
+ requires maxRead(e @ initialization.c:5:14) >= 22
simplifyTest.c: (in function fooSub)
simplifyTest.c:3:3: Possible out-of-bounds store. Unable to resolve
constraint:
- requires: : maxSet ((s @ simplifyTest.c:3:3 ) ) >= (i @
- simplifyTest.c:3:5 )
+ requires maxSet(s @ simplifyTest.c:3:3) >= i @ simplifyTest.c:3:5
needed to satisfy precondition:
- requires: : maxSet ((s @ simplifyTest.c:3:3 ) ) >= (i @
- simplifyTest.c:3:5 )
+ requires maxSet(s @ simplifyTest.c:3:3) >= i @ simplifyTest.c:3:5
simplifyTest.c: (in function fooAdd)
simplifyTest.c:10:3: Possible out-of-bounds store. Unable to resolve
constraint:
- requires: : maxSet ((s @ simplifyTest.c:10:3 ) ) >= ((i @
- simplifyTest.c:10:5 ) ) + (( 2 ) )
+ requires maxSet(s @ simplifyTest.c:10:3) >= i @ simplifyTest.c:10:5 + 2
needed to satisfy precondition:
- requires: : maxSet ((s @ simplifyTest.c:10:3 ) ) >= ((i @
- simplifyTest.c:10:5 ) ) + (( 2 ) )
+ requires maxSet(s @ simplifyTest.c:10:3) >= i @ simplifyTest.c:10:5 + 2
strncatNotReallyGood.c: (in function NotGoodfunc)
strncatNotReallyGood.c:4:29: Passed storage buffer not completely defined
(*buffer is undefined): strncat (buffer, ...)
strncatNotReallyGood.c:4:21: Possible out-of-bounds store. Unable to resolve
constraint:
- requires: : maxRead ((buffer @ strncatNotReallyGood.c:4:29 ) ) <= ( 0 )
+ requires maxRead(buffer @ strncatNotReallyGood.c:4:29) <= 0
needed to satisfy precondition:
- requires: : maxSet ((buffer @ strncatNotReallyGood.c:4:29 ) ) >= (maxRead
- ((buffer @ strncatNotReallyGood.c:4:29 ) )) + (( 255 ) )
- derived from strncat precondition: requires: :
- maxSet ((<parameter 1> ) ) >= (maxRead ((<parameter 1> ) )) +
- ((<parameter 3> ) )
+ requires maxSet(buffer @ strncatNotReallyGood.c:4:29) >= maxRead(buffer @
+ strncatNotReallyGood.c:4:29) + 255
+ derived from strncat precondition: requires maxSet(<parameter 1>) >=
+ maxRead(<parameter 1>) + <parameter 3>
Finished LCLint checking --- 8 code errors found
mystrncat.c:13:13: Passed storage b not completely defined (*b is undefined):
mystrncat (b, ...)
mystrncat.c:12:3: Possible out-of-bounds store. Unable to resolve constraint:
- requires: : maxRead ((buffer @ mystrncat.c:12:13 ) ) <= ( 0 )
+ requires maxRead(buffer @ mystrncat.c:12:13) <= 0
needed to satisfy precondition:
- requires: : maxSet ((buffer @ mystrncat.c:12:13 ) ) >= (maxRead ((buffer
- @ mystrncat.c:12:13 ) )) + (( 255 ) )
- derived from mystrncat precondition: requires: :
- maxSet ((<parameter 1> ) ) >= (maxRead ((<parameter 1> ) )) +
- ((<parameter 3> ) )
+ requires maxSet(buffer @ mystrncat.c:12:13) >= maxRead(buffer @
+ mystrncat.c:12:13) + 255
+ derived from mystrncat precondition:
+ requires maxSet(<parameter 1>) >= maxRead(<parameter 1>) + <parameter 3>
mystrncat.c:13:3: Possible out-of-bounds store. Unable to resolve constraint:
- requires: : maxRead ((malloc(256) @ mystrncat.c:10:7 ) ) <= ( 0 )
+ requires maxRead(malloc(256) @ mystrncat.c:10:7) <= 0
needed to satisfy precondition:
- requires: : maxSet ((b @ mystrncat.c:13:13 ) ) >= (maxRead ((b @
- mystrncat.c:13:13 ) )) + (( 255 ) )
- derived from mystrncat precondition: requires: :
- maxSet ((<parameter 1> ) ) >= (maxRead ((<parameter 1> ) )) +
- ((<parameter 3> ) )
+ requires maxSet(b @ mystrncat.c:13:13) >= maxRead(b @ mystrncat.c:13:13) +
+ 255
+ derived from mystrncat precondition:
+ requires maxSet(<parameter 1>) >= maxRead(<parameter 1>) + <parameter 3>
Finished LCLint checking --- 4 code errors found, as expected
mystrncat.c:13:13: Passed storage b not completely defined (*b is undefined):
mystrncat (b, ...)
mystrncat.c:12:3: Possible out-of-bounds store. Unable to resolve constraint:
- requires: : maxRead ((buffer @ mystrncat.c:12:13 ) ) <= ( 0 )
+ requires maxRead(buffer @ mystrncat.c:12:13) <= 0
needed to satisfy precondition:
- requires: : maxSet ((buffer @ mystrncat.c:12:13 ) ) >= (maxRead ((buffer
- @ mystrncat.c:12:13 ) )) + (( 255 ) )
- derived from mystrncat precondition: requires: :
- maxSet ((<parameter 1> ) ) >= (maxRead ((<parameter 1> ) )) +
- ((<parameter 3> ) )
+ requires maxSet(buffer @ mystrncat.c:12:13) >= maxRead(buffer @
+ mystrncat.c:12:13) + 255
+ derived from mystrncat precondition:
+ requires maxSet(<parameter 1>) >= maxRead(<parameter 1>) + <parameter 3>
mystrncat.c:13:3: Possible out-of-bounds store. Unable to resolve constraint:
- requires: : maxRead ((malloc(256) @ mystrncat.c:10:7 ) ) <= ( 0 )
+ requires maxRead(malloc(256) @ mystrncat.c:10:7) <= 0
needed to satisfy precondition:
- requires: : maxSet ((b @ mystrncat.c:13:13 ) ) >= (maxRead ((b @
- mystrncat.c:13:13 ) )) + (( 255 ) )
- derived from mystrncat precondition: requires: :
- maxSet ((<parameter 1> ) ) >= (maxRead ((<parameter 1> ) )) +
- ((<parameter 3> ) )
+ requires maxSet(b @ mystrncat.c:13:13) >= maxRead(b @ mystrncat.c:13:13) +
+ 255
+ derived from mystrncat precondition:
+ requires maxSet(<parameter 1>) >= maxRead(<parameter 1>) + <parameter 3>
Finished LCLint checking --- 4 code errors found, as expected
-/af10/evans/LCLintDev/src/lclint noeffect.c +allmacros +checks -expect 3
noeffect.c: (in macro exprNode_swap)
noeffect.c:3:59: Assignment to macro parameter: e1
-/af10/evans/LCLintDev/src/lclint noeffect.c +allmacros +checks -expect 3
noeffect.c: (in macro exprNode_swap)
noeffect.c:3:59: Assignment to macro parameter: e1
m.c:8:5: Storage f may become null
sizeof.c: (in function f)
sizeof.c:17:1: Possible out-of-bounds store. Unable to resolve constraint:
- requires: : ( 2 ) >= ( 3 )
+ requires 2 >= 3
needed to satisfy precondition:
- requires: : maxSet ((x @ sizeof.c:17:1 ) ) >= ( 3 )
+ requires maxSet(x @ sizeof.c:17:1) >= 3
test3.c:2:6: Function t defined more than once
m.c:11:1: Previous definition of t
test3.c: (in function t)
test3.c:9:3: Possible out-of-bounds store. Unable to resolve constraint:
- requires: : ( 99 ) >= ( 101 )
+ requires 99 >= 101
needed to satisfy precondition:
- requires: : maxSet ((g @ test3.c:9:3 ) ) >= ( 101 )
+ requires maxSet(g @ test3.c:9:3) >= 101
test7.c:2:6: Function t defined more than once
m.c:11:1: Previous definition of t
test7.c: (in function t)
test7.c:6:3: Possible out-of-bounds store. Unable to resolve constraint:
- requires: : maxSet ((g @ test7.c:4:3 ) ) >= ( 4 )
+ requires maxSet(g @ test7.c:4:3) >= 4
needed to satisfy precondition:
- requires: : maxSet ((g @ test7.c:6:3 ) ) >= ( 2 )
+ requires maxSet(g @ test7.c:6:3) >= 2
test7.c:8:3: Possible out-of-bounds store. Unable to resolve constraint:
- requires: : maxSet ((j @ test7.c:8:3 ) ) >= ( 0 )
+ requires maxSet(j @ test7.c:8:3) >= 0
needed to satisfy precondition:
- requires: : maxSet ((j @ test7.c:8:3 ) ) >= ( 0 )
+ requires maxSet(j @ test7.c:8:3) >= 0
Finished LCLint checking --- 7 code errors found
sizeof.c: (in function main)
sizeof.c:6:2: Possible out-of-bounds store. Unable to resolve constraint:
- requires: : ( 2 ) >= ( 3 )
+ requires 2 >= 3
needed to satisfy precondition:
- requires: : maxSet ((x @ sizeof.c:6:2 ) ) >= ( 3 )
+ requires maxSet(x @ sizeof.c:6:2) >= 3
Finished LCLint checking --- 1 code error found
sizeof.c: (in function main)
sizeof.c:6:2: Possible out-of-bounds store. Unable to resolve constraint:
- requires: : ( 2 ) >= ( 3 )
+ requires 2 >= 3
needed to satisfy precondition:
- requires: : maxSet ((x @ sizeof.c:6:2 ) ) >= ( 3 )
+ requires maxSet(x @ sizeof.c:6:2) >= 3
Finished LCLint checking --- 1 code error found