From 03d670b689457f045987972826e570fb1e89c915 Mon Sep 17 00:00:00 2001 From: drl7x Date: Tue, 24 Jul 2001 14:54:27 +0000 Subject: [PATCH] Made make lint work. Although exprNode_doSwitchExpr surpresses too much. Splitt fcnconstraint and improved error messages. --- src/Headers/constraint.h | 28 +++--- src/Headers/constraintExpr.h | 2 +- src/Headers/herald.h | 2 +- src/Headers/herald.last | 2 +- src/Headers/local_constants.h | 4 +- src/Headers/local_constants.last | 4 +- src/Makefile | 2 +- src/Makefile.sources | 2 +- src/constraint.c | 47 ++++++---- src/constraintExpr.c | 10 +- src/constraintGeneration.c | 119 ++++++++++++++++-------- src/constraintList.c | 6 +- src/constraintTerm.c | 2 +- src/exprChecks.c | 2 + src/flags.def | 18 ++++ src/llmain.c | 4 +- test/Makefile | 17 ++-- test/abst_t.lcs | 2 +- test/abstptr.lcs | 2 +- test/alias.lcs | 2 +- test/alias2.lcs | 2 +- test/alias3.lcs | 2 +- test/alias3.lh | 2 +- test/alias4.lcs | 2 +- test/alias4.lh | 2 +- test/alias5.lcs | 2 +- test/alias5.lh | 2 +- test/argorder2.lcs | 2 +- test/argorder4.lcs | 2 +- test/args.lcs | 2 +- test/bufferTest.expect | 23 ++--- test/bufferTest.out | 23 ++--- test/cast.lcs | 2 +- test/db1/bool.lcs | 2 +- test/db1/bool.lh | 2 +- test/db1/dbase.lcs | 2 +- test/db1/dbase.lh | 2 +- test/db1/employee.lcs | 2 +- test/db1/employee.lh | 2 +- test/db1/empset.lcs | 2 +- test/db1/empset.lh | 2 +- test/db1/erc.lcs | 2 +- test/db1/erc.lh | 2 +- test/db1/eref.lcs | 2 +- test/db1/eref.lh | 2 +- test/db1/ereftab.lcs | 2 +- test/db1/ereftab.lh | 2 +- test/db2/dbase.lcs | 2 +- test/db2/dbase.lh | 2 +- test/db2/employee.lcs | 2 +- test/db2/employee.lh | 2 +- test/db2/empset.lcs | 2 +- test/db2/empset.lh | 2 +- test/db2/erc.lcs | 2 +- test/db2/erc.lh | 2 +- test/db2/eref.lcs | 2 +- test/db2/eref.lh | 2 +- test/db2/ereftab.lcs | 2 +- test/db2/ereftab.lh | 2 +- test/db3/bool.lcs | 2 +- test/db3/bool.lh | 2 +- test/db3/check.lcs | 2 +- test/db3/check.lh | 2 +- test/db3/dbase.lcs | 2 +- test/db3/dbase.lh | 2 +- test/db3/employee.lcs | 2 +- test/db3/employee.lh | 2 +- test/db3/empset.lcs | 2 +- test/db3/empset.lh | 2 +- test/db3/erc.lcs | 2 +- test/db3/erc.lh | 2 +- test/db3/eref.lcs | 2 +- test/db3/eref.lh | 2 +- test/db3/ereftab.lcs | 2 +- test/db3/ereftab.lh | 2 +- test/decl2.lcs | 2 +- test/enum.lcs | 2 +- test/for.expect | 8 +- test/for/.lclintrc | 2 +- test/glob.lcs | 2 +- test/impabstract.lcs | 2 +- test/iter.lcs | 2 +- test/macros.lcs | 2 +- test/macrosef.lcs | 2 +- test/maxset.expect | 15 +-- test/maxset/.lclintrc | 2 +- test/modtest.lcs | 2 +- test/moreBufferTests.expect | 52 ++++++----- test/mut.lcs | 2 +- test/mut.lh | 2 +- test/null6.lcd | 2 +- test/null6.lcs | 2 +- test/observer.lcs | 2 +- test/oldstyle.lcs | 2 +- test/outglob.lcs | 2 +- test/outparam.lcs | 2 +- test/repexpose.lcs | 2 +- test/repexpose.lh | 2 +- test/simplebufferConstraintTests.expect | 30 +++--- test/sizeoftest.expect | 8 +- test/sizeoftest.out | 8 +- test/special.lcs | 2 +- test/strchr/strchr.c | 2 +- test/tests2.2/bool.lcs | 2 +- test/tests2.4/subdir/main.lcs | 2 +- test/tests2.5/newlint.lcd | 2 +- test/tq.lcs | 2 +- test/ud2.lcs | 2 +- 108 files changed, 346 insertions(+), 258 deletions(-) diff --git a/src/Headers/constraint.h b/src/Headers/constraint.h index 40ab60a..225a790 100644 --- a/src/Headers/constraint.h +++ b/src/Headers/constraint.h @@ -38,13 +38,13 @@ extern void constraint_free (/*@only@*/ constraint p_c); /*@i22*/ /*@-czechfcns*/ -extern constraint constraint_makeReadSafeExprNode ( /*@dependent@*/ /*@oberserver@*/ exprNode p_po, /*@dependent@*/ /*@oberserver@*/ exprNode p_ind); +extern constraint constraint_makeReadSafeExprNode ( /*@dependent@*/ /*@observer@*/ exprNode p_po, /*@dependent@*/ /*@observer@*/ exprNode p_ind); -extern /*@only@*/ constraint constraint_makeWriteSafeExprNode (/*@dependent@*/ /*@oberserver@*/ exprNode p_po, /*@dependent@*/ /*@oberserver@*/ exprNode p_ind); +extern /*@only@*/ constraint constraint_makeWriteSafeExprNode (/*@dependent@*/ /*@observer@*/ exprNode p_po, /*@dependent@*/ /*@observer@*/ exprNode p_ind); -extern /*@only@*/ constraint constraint_makeReadSafeInt (/*@dependent@*/ /*@oberserver@*/ exprNode p_t1, int p_index); +extern /*@only@*/ constraint constraint_makeReadSafeInt (/*@dependent@*/ /*@observer@*/ exprNode p_t1, int p_index); -extern /*@only@*/ constraint constraint_makeEnsureMaxReadAtLeast (/*@dependent@*/ /*@oberserver@*/ exprNode p_t1, /*@dependent@*/ /*@oberserver@*/ exprNode p_t2, fileloc p_sequencePoint); +extern /*@only@*/ constraint constraint_makeEnsureMaxReadAtLeast (/*@dependent@*/ /*@observer@*/ exprNode p_t1, /*@dependent@*/ /*@observer@*/ exprNode p_t2, fileloc p_sequencePoint); extern void constraint_overWrite (constraint p_c1, /*@observer@*/ constraint p_c2) /*@modifies p_c1 @*/; @@ -61,24 +61,24 @@ extern /*@only@*/ cstring constraint_unparse (/*@temp@*/ /*@observer@*/ constrai extern /*@only@*/ cstring constraint_print (/*@temp@*/ /*@observer@*/ constraint p_c) /*@*/; -extern /*@only@*/ constraint constraint_makeWriteSafeInt (/*@dependent@*/ /*@oberserver@*/ exprNode p_po, int p_ind); +extern /*@only@*/ constraint constraint_makeWriteSafeInt (/*@dependent@*/ /*@observer@*/ exprNode p_po, int p_ind); extern exprNode exprNode_copyConstraints (/*@returned@*/ exprNode p_dst, exprNode p_src) /*@modifies p_dst @*/; -extern /*@only@*/ constraint constraint_makeEnsureEqual (/*@dependent@*/ /*@oberserver@*/ exprNode p_e1, /*@dependent@*/ /*@oberserver@*/ exprNode p_e2, fileloc p_sequencePoint); +extern /*@only@*/ constraint constraint_makeEnsureEqual (/*@dependent@*/ /*@observer@*/ exprNode p_e1, /*@dependent@*/ /*@observer@*/ exprNode p_e2, fileloc p_sequencePoint); -extern /*@only@*/ constraint constraint_makeMaxSetSideEffectPostIncrement (/*@dependent@*/ /*@oberserver@*/ exprNode p_e, fileloc p_sequencePoint); +extern /*@only@*/ constraint constraint_makeMaxSetSideEffectPostIncrement (/*@dependent@*/ /*@observer@*/ exprNode p_e, fileloc p_sequencePoint); extern constraint constraint_preserveOrig (/*@returned@*/ constraint p_c) /*@modifies p_c @*/; extern /*@only@*/ constraint constraint_doSRefFixBaseParam (/*@returned@*/ /*@only@*/ constraint p_precondition, exprNodeList p_arglist); extern /*@only@*/ cstring constraint_printDetailed (constraint p_c); -extern /*@only@*/ constraint constraint_makeEnsureLessThan (/*@dependent@*/ /*@oberserver@*/ exprNode p_e1, /*@dependent@*/ /*@oberserver@*/ exprNode p_e2, fileloc p_sequencePoint); -extern /*@only@*/ constraint constraint_makeEnsureLessThanEqual (/*@dependent@*/ /*@oberserver@*/ exprNode p_e1, /*@dependent@*/ /*@observer@*/ exprNode p_e2, fileloc p_sequencePoint); +extern /*@only@*/ constraint constraint_makeEnsureLessThan (/*@dependent@*/ /*@observer@*/ exprNode p_e1, /*@dependent@*/ /*@observer@*/ exprNode p_e2, fileloc p_sequencePoint); +extern /*@only@*/ constraint constraint_makeEnsureLessThanEqual (/*@dependent@*/ /*@observer@*/ exprNode p_e1, /*@dependent@*/ /*@observer@*/ exprNode p_e2, fileloc p_sequencePoint); -extern /*@only@*/ constraint constraint_makeEnsureGreaterThan (/*@dependent@*/ /*@oberserver@*/ exprNode p_e1, /*@dependent@*/ /*@oberserver@*/ exprNode p_e2, fileloc p_sequencePoint); -extern /*@only@*/ constraint constraint_makeEnsureGreaterThanEqual (/*@dependent@*/ /*@oberserver@*/ exprNode p_e1, /*@dependent@*/ /*@oberserver@*/ exprNode p_e2, fileloc p_sequencePoint); +extern /*@only@*/ constraint constraint_makeEnsureGreaterThan (/*@dependent@*/ /*@observer@*/ exprNode p_e1, /*@dependent@*/ /*@observer@*/ exprNode p_e2, fileloc p_sequencePoint); +extern /*@only@*/ constraint constraint_makeEnsureGreaterThanEqual (/*@dependent@*/ /*@observer@*/ exprNode p_e1, /*@dependent@*/ /*@observer@*/ exprNode p_e2, fileloc p_sequencePoint); /*drl add 11/28/2000 */ extern /*@only@*/ constraint constraint_makeSRefWriteSafeInt (sRef p_s, int p_ind); @@ -93,9 +93,9 @@ extern /*@only@*/ constraint constraint_makeSRefSetBufferSize (sRef p_s, long in extern /*@only@*/ constraint constraint_doFixResult (constraint p_postcondition, /*@dependent@*/ /*@observer@*/ exprNode p_fcnCall); -extern /*@only@*/ constraint constraint_makeEnsureLteMaxRead(/*@dependent@*/ /*@oberserver@*/ exprNode p_index, /*@dependent@*/ /*@oberserver@*/ exprNode p_buffer); +extern /*@only@*/ constraint constraint_makeEnsureLteMaxRead(/*@dependent@*/ /*@observer@*/ exprNode p_index, /*@dependent@*/ /*@observer@*/ exprNode p_buffer); -extern /*@only@*/ constraint constraint_makeMaxSetSideEffectPostDecrement (/*@dependent@*/ /*@oberserver@*/ exprNode p_e, fileloc p_sequencePoint); +extern /*@only@*/ constraint constraint_makeMaxSetSideEffectPostDecrement (/*@dependent@*/ /*@observer@*/ exprNode p_e, fileloc p_sequencePoint); extern bool constraint_search (constraint p_c, constraintExpr p_old); @@ -117,7 +117,7 @@ extern bool constraint_same (constraint p_c1, constraint p_c2) ; /*@only@*/ cstring constraint_printOr (constraint p_c) /*@*/; extern void constraint_printErrorPostCondition (constraint p_c, fileloc p_loc) ; extern constraint constraint_setFcnPre (/*@returned@*/ constraint p_c) ; -extern constraint constraint_origAddGeneratingExpr (/*@returned@*/ constraint p_c, /*@dependent@*/ /*@oberserver@*/ exprNode p_e) ; +extern constraint constraint_origAddGeneratingExpr (/*@returned@*/ constraint p_c, /*@dependent@*/ /*@observer@*/ exprNode p_e) ; extern bool /*@alt void@*/ exprNode_generateConstraints (/*@dependent@*/ exprNode p_e) ; constraint constraint_togglePostOrig (/*@returned@*/ constraint p_c); diff --git a/src/Headers/constraintExpr.h b/src/Headers/constraintExpr.h index bc1f609..db9699e 100644 --- a/src/Headers/constraintExpr.h +++ b/src/Headers/constraintExpr.h @@ -71,7 +71,7 @@ bool constraintExpr_search (/*@observer@*/ /*@temp@*/ constraintExpr p_c, /*@obs /*@only@*/ fileloc constraintExpr_getFileloc (constraintExpr p_expr); -/*@only@*/ constraintExpr constraintExpr_makeSRefMaxset ( /*@temp@*/ /*@oberver@*/ sRef p_s); +/*@only@*/ constraintExpr constraintExpr_makeSRefMaxset ( /*@temp@*/ /*@observer@*/ sRef p_s); /*@only@*/ constraintExpr constraintExpr_makeSRefMaxRead(/*@temp@*/ /*@observer@*/ sRef p_s); diff --git a/src/Headers/herald.h b/src/Headers/herald.h index 36662b4..f929ab5 100644 --- a/src/Headers/herald.h +++ b/src/Headers/herald.h @@ -4,4 +4,4 @@ /*@constant observer char *LCL_PARSE_VERSION;@*/ # define LCL_PARSE_VERSION "LCLint 3.0.0.9" /*@constant observer char *LCL_COMPILE;@*/ -# define LCL_COMPILE "Compiled using gcc -Wall -g on Linux paisley 2.4.3-12 #1 Fri Jun 8 13:35:30 EDT 2001 i686 unknown by evans" +# define LCL_COMPILE "Compiled using gcc -DSTDC_HEADERS=1 -g -Wall on Linux fowler 2.4.3-12 #1 Fri Jun 8 13:35:30 EDT 2001 i686 unknown by drl7x" diff --git a/src/Headers/herald.last b/src/Headers/herald.last index 36662b4..f929ab5 100644 --- a/src/Headers/herald.last +++ b/src/Headers/herald.last @@ -4,4 +4,4 @@ /*@constant observer char *LCL_PARSE_VERSION;@*/ # define LCL_PARSE_VERSION "LCLint 3.0.0.9" /*@constant observer char *LCL_COMPILE;@*/ -# define LCL_COMPILE "Compiled using gcc -Wall -g on Linux paisley 2.4.3-12 #1 Fri Jun 8 13:35:30 EDT 2001 i686 unknown by evans" +# define LCL_COMPILE "Compiled using gcc -DSTDC_HEADERS=1 -g -Wall on Linux fowler 2.4.3-12 #1 Fri Jun 8 13:35:30 EDT 2001 i686 unknown by drl7x" diff --git a/src/Headers/local_constants.h b/src/Headers/local_constants.h index c4c3a88..73e13fc 100644 --- a/src/Headers/local_constants.h +++ b/src/Headers/local_constants.h @@ -2,6 +2,6 @@ /*@constant observer char *SYSTEM_LIBDIR;@*/ # define SYSTEM_LIBDIR "/usr/include" /*@constant observer char *DEFAULT_LARCHPATH;@*/ -# define DEFAULT_LARCHPATH "/usr/local/lclint-2.5m/lib" +# define DEFAULT_LARCHPATH ".:/af9/drl7x/re3/LCLintDev/lib" /*@constant observer char *DEFAULT_LCLIMPORTDIR;@*/ -# define DEFAULT_LCLIMPORTDIR "/usr/local/lclint-2.5m/imports" +# define DEFAULT_LCLIMPORTDIR "/af9/drl7x/re3/LCLintDev/imports" diff --git a/src/Headers/local_constants.last b/src/Headers/local_constants.last index c4c3a88..73e13fc 100644 --- a/src/Headers/local_constants.last +++ b/src/Headers/local_constants.last @@ -2,6 +2,6 @@ /*@constant observer char *SYSTEM_LIBDIR;@*/ # define SYSTEM_LIBDIR "/usr/include" /*@constant observer char *DEFAULT_LARCHPATH;@*/ -# define DEFAULT_LARCHPATH "/usr/local/lclint-2.5m/lib" +# define DEFAULT_LARCHPATH ".:/af9/drl7x/re3/LCLintDev/lib" /*@constant observer char *DEFAULT_LCLIMPORTDIR;@*/ -# define DEFAULT_LCLIMPORTDIR "/usr/local/lclint-2.5m/imports" +# define DEFAULT_LCLIMPORTDIR "/af9/drl7x/re3/LCLintDev/imports" diff --git a/src/Makefile b/src/Makefile index 2dd90c0..0332ea9 100644 --- a/src/Makefile +++ b/src/Makefile @@ -389,7 +389,7 @@ linttest: ${LCLINTNEW} -f lclint.lclintrc $(CPPFLAGS) +singleinclude cpphash.c +forcehints -misplacedsharequal +showsourceloc -unrecogcomments -supcounts -fcnuse -exportlocal -constuse -mts file -mts filerw +partial lint: - ../bin/lclint -f lclint.lclintrc $(CPPFLAGS) +singleinclude $(ALLSRC) -dump lclint +forcehints -misplacedsharequal +showsourceloc -unrecogcomments -supcounts -fcnuse -exportlocal -constuse + ../bin/lclint -f lclint.lclintrc $(CPPFLAGS) +singleinclude $(ALLSRC) -dump lclint +forcehints -misplacedsharequal +showsourceloc -supcounts -fcnuse -exportlocal -constuse # -mts file diff --git a/src/Makefile.sources b/src/Makefile.sources index 0cb9984..7281241 100644 --- a/src/Makefile.sources +++ b/src/Makefile.sources @@ -27,13 +27,13 @@ GRAMS = cgrammar.y cscanner.l llgrammar.y signature.y mtgrammar.y GRAMSRC = cgrammar.c cscanner.c mtscanner.c mtreader.c mtgrammar.c OVERFLOWCHSRC = \ + constraintGeneration.c \ constraintTerm.c \ constraintExprData.c \ constraintExpr.c \ constraint.c \ constraintList.c \ constraintResolve.c \ - constraintGeneration.c \ constraintOutput.c \ forjunk.c diff --git a/src/constraint.c b/src/constraint.c index 8488734..4f2b892 100644 --- a/src/constraint.c +++ b/src/constraint.c @@ -309,13 +309,16 @@ static bool checkForMaxSet (constraint c) bool constraint_hasMaxSet(constraint c) { + if (checkForMaxSet(c) ) + return TRUE; + if (c->orig != NULL) { if (checkForMaxSet(c->orig) ) return TRUE; } - return (checkForMaxSet(c) ); + return FALSE; } constraint constraint_makeReadSafeExprNode ( exprNode po, exprNode ind) @@ -739,7 +742,10 @@ void constraint_printError (constraint c, fileloc loc) } else { - voptgenerror (FLG_FUNCTIONCONSTRAINT, string, errorLoc); + if (constraint_hasMaxSet (c) ) + voptgenerror (FLG_ARRAYBOUNDS, string, errorLoc); + else + voptgenerror (FLG_ARRAYBOUNDSREAD, string, errorLoc); } fileloc_free(temp); errorLoc = NULL; @@ -769,6 +775,7 @@ static cstring constraint_printDeep (constraint c) if (c->orig != constraint_undefined) { + st = cstring_appendChar(st, '\n'); genExpr = exprNode_unparse(c->orig->generatingExpr); if (!c->post) { @@ -776,7 +783,7 @@ static cstring constraint_printDeep (constraint c) st = cstring_concatFree(st, (message(" derived from %s precondition: %q", genExpr, constraint_printDeep(c->orig) ) ) ); else - st = cstring_concatFree(st,(message(" needed to satisfy %q", + st = cstring_concatFree(st,(message(" needed to satisfy precondition:\n%q", constraint_printDeep(c->orig) ) ) ); @@ -823,32 +830,38 @@ static /*@only@*/ cstring constraint_printDetailedPostCondition (/*@observer@*/ cstring constraint_printDetailed (constraint c) { cstring st = cstring_undefined; - cstring genExpr; + cstring temp = cstring_undefined; + cstring genExpr; if (!c->post) { - st = message ("Unresolved constraint:\nLclint is unable to resolve %q", constraint_printDeep (c) ); + st = message ("Unable to resolve constraint:\n%q", constraint_printDeep (c) ); } else { st = message ("Block Post condition:\nThis function block has the post condition %q", constraint_printDeep (c) ); } + if (constraint_hasMaxSet(c) ) + { + temp = cstring_makeLiteral("Possible out-of-bounds store. "); + } + else + { + temp = cstring_makeLiteral("Possible out-of-bounds read. "); + } + + st = cstring_concatFree(temp,st); + genExpr = exprNode_unparse (c->generatingExpr); if (context_getFlag (FLG_CONSTRAINTLOCATION) ) { - cstring temp; - // llassert (c->generatingExpr); - temp = message ("\nOriginal Generating expression %q: %s\n", fileloc_unparse( exprNode_getfileloc (c->generatingExpr) ), - genExpr ); + temp = message ("\nConstraint generated from expression: %s at %q\n", + genExpr, + fileloc_unparse( exprNode_getfileloc (c->generatingExpr) ) + ); st = cstring_concatFree (st, temp); - - if (constraint_hasMaxSet(c) ) - { - temp = message ("Has MaxSet\n"); - st = cstring_concatFree (st, temp); - } } return st; } @@ -860,11 +873,11 @@ cstring constraint_printDetailed (constraint c) llassert (c !=NULL); if (c->post) { - type = cstring_makeLiteral ("Ensures: "); + type = cstring_makeLiteral ("ensures: "); } else { - type = cstring_makeLiteral ("Requires: "); + type = cstring_makeLiteral ("requires: "); } st = message ("%q: %q %q %q", type, diff --git a/src/constraintExpr.c b/src/constraintExpr.c index d747ad6..39e416e 100644 --- a/src/constraintExpr.c +++ b/src/constraintExpr.c @@ -789,13 +789,13 @@ static cstring constraintExprUnaryOpKind_print (constraintExprUnaryOpKind op) switch (op) { case MAXSET: - return message("MAXSET"); + return message("maxSet"); case MINSET: - return message("MINSET"); + return message("minSet"); case MAXREAD: - return message("MAXREAD"); + return message("maxRead"); case MINREAD: - return message("MINREAD"); + return message("minRead"); default: llassert(FALSE); return message ("<(Unary OP OTHER>"); @@ -1484,7 +1484,7 @@ bool constraintExpr_hasMaxSet (constraintExpr expr) /*@*/ t = constraintExpr_unparse(expr); - if (cstring_containsLit(t, "MAXSET") != NULL ) + if (cstring_containsLit(t, "maxSet") != NULL ) { cstring_free(t); return (TRUE); diff --git a/src/constraintGeneration.c b/src/constraintGeneration.c index 9e413d3..5919bee 100644 --- a/src/constraintGeneration.c +++ b/src/constraintGeneration.c @@ -49,7 +49,7 @@ static constraintList checkCall (/*@dependent@*/ exprNode p_fcn, exprNodeList p */ //} -static bool exprNode_isUnhandled (/*@dependent@*/ /*@obsever@*/ exprNode e) +static bool exprNode_isUnhandled (/*@dependent@*/ /*@observer@*/ exprNode e) { llassert( exprNode_isDefined(e) ); switch (e->kind) @@ -182,7 +182,7 @@ if (exprNode_handleError (e) != NULL) } -static void exprNode_stmt ( /*@dependent@*/ exprNode e) +static void exprNode_stmt ( /*@dependent@*/ /*@temp@*/ exprNode e) { exprNode snode; fileloc loc; @@ -560,10 +560,18 @@ static void doFor (/*@dependent@*/ exprNode e, /*@dependent@*/ exprNode forPred, } -static void exprNode_doGenerateConstraintSwitch ( exprNode switchExpr, - exprNode body, constraintList * currentRequires, constraintList * - currentEnsures, constraintList * savedRequires, constraintList * +static /*@dependent@*/ exprNode exprNode_makeDependent(/*@returned@*/ exprNode e) +{ + /*@-temptrans@*/ + return e; + /*@=temptrans@*/ +} + +static void exprNode_doGenerateConstraintSwitch (/*@dependent@*/ exprNode switchExpr, + /*@dependent@*/ exprNode body, /*@special@*/ constraintList * currentRequires, /*@special@*/ constraintList * + currentEnsures, /*@special@*/ constraintList * savedRequires, /*@special@*/ constraintList * savedEnsures) + /*@post:only *currentRequires, *currentEnsures, *savedRequires, *savedEnsures @*/ /*@defines *currentRequires, *currentEnsures, *savedRequires, *savedEnsures @*/ { exprNode stmt, stmtList; @@ -573,7 +581,14 @@ static void exprNode_doGenerateConstraintSwitch ( exprNode switchExpr, if (exprNode_isError(body) ) { + *currentRequires = constraintList_makeNew(); + *currentEnsures = constraintList_makeNew(); + + *savedRequires = constraintList_makeNew(); + *savedEnsures = constraintList_makeNew(); + /*@-onlytrans@*/ return; + /*@=onlytrans@*/ } if (body->kind != XPR_STMTLIST ) @@ -585,12 +600,16 @@ stmtlist: %s", // llassert(body->kind == XPR_STMT ); stmt = body; stmtList = exprNode_undefined; + stmt = exprNode_makeDependent(stmt); + stmtList = exprNode_makeDependent(stmtList); + } + else + { + stmt = exprData_getPairB(body->edata); + stmtList = exprData_getPairA(body->edata); + stmt = exprNode_makeDependent(stmt); + stmtList = exprNode_makeDependent(stmtList); } - else - { - stmt = exprData_getPairB(body->edata); - stmtList = exprData_getPairA(body->edata); - } DPRINTF((message("exprNode_doGenerateConstraintSwitch: stmtlist: %s stmt: %s", @@ -602,9 +621,14 @@ stmt: %s", savedRequires, savedEnsures ); if (exprNode_isError(stmt) ) + /*@-onlytrans@*/ return; + /*@=onlytrans@*/ exprNode_stmt(stmt); + + switchExpr = exprNode_makeDependent (switchExpr); + //, FALSE, FALSE, exprNode_getfileloc(stmt) ); if (! exprNode_isCaseMarker(stmt) ) @@ -618,9 +642,9 @@ stmt: %s", temp = constraintList_reflectChanges (stmt->requiresConstraints, *currentEnsures); - *currentRequires = constraintList_mergeRequiresFreeFirst - (*currentRequires, - temp); + *currentRequires = constraintList_mergeRequiresFreeFirst( + *currentRequires, + temp); constraintList_free(temp); @@ -632,7 +656,10 @@ stmt: %s", exprNode_unparse(switchExpr), exprNode_unparse(body), constraintList_print(*currentRequires), constraintList_print(*currentEnsures) ) )); + /*@-onlytrans@*/ return; + /*@=onlytrans@*/ + } if (exprNode_isCaseMarker(stmt) && exprNode_mustEscape(stmtList) ) @@ -648,19 +675,21 @@ stmt: %s", if (constraintList_isUndefined(*savedEnsures) && constraintList_isUndefined(*savedRequires) ) { + llassert(constraintList_isUndefined(*savedEnsures) ); + llassert(constraintList_isUndefined(*savedRequires) ); *savedEnsures = constraintList_copy(*currentEnsures); *savedRequires = constraintList_copy(*currentRequires); } - else - { - DPRINTF (( message("Doing logical or") )); - temp = constraintList_logicalOr (*savedEnsures, *currentEnsures); - constraintList_free (*savedEnsures); - *savedEnsures = temp; - - *savedRequires = constraintList_mergeRequiresFreeFirst (*savedRequires, *currentRequires); - } - + else + { + DPRINTF (( message("Doing logical or") )); + temp = constraintList_logicalOr (*savedEnsures, *currentEnsures); + constraintList_free (*savedEnsures); + *savedEnsures = temp; + + *savedRequires = constraintList_mergeRequiresFreeFirst (*savedRequires, *currentRequires); + } + con = constraint_makeEnsureEqual (switchExpr, exprData_getSingle (stmt->edata), exprNode_getfileloc(stmt) ); @@ -703,29 +732,40 @@ stmt: %s", if (exprNode_isError(stmtList) ) { constraintList_free(*currentEnsures); - *currentEnsures = constraintList_copy(ensuresTemp); - } - else - { - temp = constraintList_logicalOr (*currentEnsures, ensuresTemp); + *currentEnsures = constraintList_copy(ensuresTemp); + constraintList_free(ensuresTemp); - constraintList_free(*currentEnsures); - constraintList_free(ensuresTemp); + } + else + { + + temp = constraintList_logicalOr (*currentEnsures, ensuresTemp); + + constraintList_free(*currentEnsures); + constraintList_free(ensuresTemp); - *currentEnsures = temp; - } + *currentEnsures = temp; + } constraintList_free(*currentRequires); - + *currentRequires = constraintList_makeNew(); } + else + { + // we handle the case of ! exprNode_isCaseMarker above + // the else if clause should always be true. + BADEXIT; + } DPRINTF(( message("returning from exprNode_doGenerateConstraintSwitch: (switch %s) %s currentRequires:" "%s currentEnsures:%s", exprNode_unparse(switchExpr), exprNode_unparse(body), constraintList_print(*currentRequires), constraintList_print(*currentEnsures) ) )); + /*@-onlytrans@*/ return; + /*@=onlytrans@*/ } @@ -747,12 +787,13 @@ static void exprNode_generateConstraintSwitch ( exprNode switchStmt) if ( body->kind == XPR_BLOCK) body = exprData_getSingle(body->edata); + /* constraintsRequires = constraintList_undefined; constraintsEnsures = constraintList_undefined; lastRequires = constraintList_makeNew(); lastEnsures = constraintList_makeNew(); - + */ exprNode_doGenerateConstraintSwitch (switchExpr, body, &lastRequires, &lastEnsures, &constraintsRequires, &constraintsEnsures); @@ -769,11 +810,11 @@ static void exprNode_generateConstraintSwitch ( exprNode switchStmt) constraintList_free (constraintsRequires); constraintList_free (constraintsEnsures); } - else - { - switchStmt->ensuresConstraints = constraintList_copy(lastEnsures); - switchStmt->requiresConstraints = constraintList_copy(lastRequires); - } + else + { + switchStmt->ensuresConstraints = constraintList_copy(lastEnsures); + switchStmt->requiresConstraints = constraintList_copy(lastRequires); + } constraintList_free (lastRequires); constraintList_free (lastEnsures); diff --git a/src/constraintList.c b/src/constraintList.c index c9fe9a5..4fcf3a3 100644 --- a/src/constraintList.c +++ b/src/constraintList.c @@ -51,7 +51,7 @@ # define end_constraintList_elements_private }}} -constraintList constraintList_makeNew () +/*@only@*/ constraintList constraintList_makeNew () { constraintList s = (constraintList) dmalloc (sizeof (*s)); @@ -360,7 +360,7 @@ constraintList_free (/*@only@*/ constraintList s) } constraintList -constraintList_copy (/*@oberserver@*/ /*@temp@*/ constraintList s) +constraintList_copy (/*@observer@*/ /*@temp@*/ constraintList s) { constraintList ret = constraintList_makeNew (); @@ -384,7 +384,7 @@ constraintList constraintList_preserveOrig (constraintList c) return c; } -constraintList constraintList_preserveCallInfo (/*@returned@*/ constraintList c,/*@observer@*/ /*@depenent@*/ /*@observer@*/ exprNode fcn) +constraintList constraintList_preserveCallInfo (/*@returned@*/ constraintList c,/*@observer@*/ /*@dependent@*/ /*@observer@*/ exprNode fcn) { DPRINTF((message("constraintList_preserveOrig preserving the originial constraints for %s ", constraintList_print (c) ) )); diff --git a/src/constraintTerm.c b/src/constraintTerm.c index 6f88df0..288d6db 100644 --- a/src/constraintTerm.c +++ b/src/constraintTerm.c @@ -132,7 +132,7 @@ constraintTermType constraintTerm_getKind (constraintTerm t) return (t->value.sref); } -/*@only@*/ constraintTerm constraintTerm_makeExprNode (/*@depenedent@*/ exprNode e) +/*@only@*/ constraintTerm constraintTerm_makeExprNode (/*@dependent@*/ exprNode e) { constraintTerm ret = new_constraintTermExpr(); ret->loc = fileloc_copy(exprNode_getfileloc(e)); diff --git a/src/exprChecks.c b/src/exprChecks.c index e662771..3691147 100644 --- a/src/exprChecks.c +++ b/src/exprChecks.c @@ -938,6 +938,8 @@ void exprNode_checkFunction (/*@unused@*/ uentry ue, /*@only@*/ exprNode fcnBody // check if errors will printed if (! (context_getFlag(FLG_DEBUGFUNCTIONCONSTRAINT) || context_getFlag(FLG_FUNCTIONCONSTRAINT) || + context_getFlag(FLG_ARRAYBOUNDS) || + context_getFlag(FLG_ARRAYBOUNDSREAD) || context_getFlag(FLG_CHECKPOST) ) ) diff --git a/src/flags.def b/src/flags.def index e9626b9..46abe44 100644 --- a/src/flags.def +++ b/src/flags.def @@ -2818,6 +2818,24 @@ static flaglist flags = "This flag is for debuging. It causes lclint to perform buffer overflow checking even if the error will be surpressed. Normal buffer overflow checking will only be performed if errors would be printed. ", 0, 0 }, + + { + FK_NT, FK_MEMORY, modeFlag, + "arrayBounds", + FLG_ARRAYBOUNDS, + "Possible out-of-bounds store. Unable to resolve constraint:", + "LCLint was unable to resolve a constraint at the top of the function. If code is correct consider using explict annotation assertions, ", + 0, 0 + }, + { + FK_NT, FK_MEMORY, modeFlag, + "arrayBoundsRead", + FLG_ARRAYBOUNDSREAD, + "Possible out-of-bounds read. Unable to resolve constraint:", + "LCLint was unable to resolve a constraint at the top of the function. If code is correct consider using explict annotation assertions, ", + 0, 0 + }, + { FK_NT, FK_MEMORY, modeFlag, "fcnconstraint", diff --git a/src/llmain.c b/src/llmain.c index 0829648..8210121 100644 --- a/src/llmain.c +++ b/src/llmain.c @@ -94,7 +94,7 @@ static void showHelp (void); static void interrupt (int p_i); static void loadrc (/*@open@*/ FILE *p_rcfile, cstringSList *p_passThroughArgs) - /*@ensures closed p_rcfile@*/ ; + ; // /*@ensures closed p_rcfile@*/ ; static void describeVars (void); static bool specialFlagsHelp (char *p_next); @@ -2146,7 +2146,7 @@ llexit (int status) void loadrc (/*@open@*/ FILE *rcfile, cstringSList *passThroughArgs) - /*@ensures closed rcfile@*/ + // /*@ensures closed rcfile@*/ { char *s = mstring_create (MAX_LINE_LENGTH); char *os = s; diff --git a/test/Makefile b/test/Makefile index 6d0849b..6bcd22d 100644 --- a/test/Makefile +++ b/test/Makefile @@ -421,7 +421,7 @@ mongoincludes: $(LCLINTR) mongoincludes.c -includenest 5 -expect 0 mystrncat: - $(LCLINTR) mystrncat.c +fcnconstraint -expect 4 + $(LCLINTR) mystrncat.c +arrayBounds +arrayBoundsRead -expect 4 noeffect: ${LCLINT} noeffect.c +allmacros +checks -expect 3 @@ -651,19 +651,19 @@ tests2.4: sizeoftest: @cd sizeoftest; \ - $(LCLINTR) +functionconstraint sizeof.c + $(LCLINTR) +arrayBounds +arrayBoundsRead sizeof.c bufferTest: @cd bufferTest; \ - $(LCLINTR) +functionconstraint test4.c test6.c + $(LCLINTR) +arrayBounds +arrayBoundsRead test4.c test6.c simplebufferConstraintTests: @cd simplebufferConstraintTests; \ - $(LCLINTR) +functionconstraint m.c sizeof.c test3.c test7.c + $(LCLINTR) +arrayBounds +arrayBoundsRead m.c sizeof.c test3.c test7.c moreBufferTests: @cd moreBufferTests; \ - $(LCLINTR) +functionconstraint +orconstraint unrecogCall.c strrchr.c initialization.c simplifyTest.c strncatNotReallyGood.c strncatReallyGood.c + $(LCLINTR) +arrayBounds +arrayBoundsRead +orconstraint unrecogCall.c strrchr.c initialization.c simplifyTest.c strncatNotReallyGood.c strncatReallyGood.c maxset: @cd maxset; \ @@ -673,16 +673,15 @@ maxset: globalbufferannotation: @cd globalbufferannotation; \ - $(LCLINTR) +functionconstraint globalvariable.c - + $(LCLINTR) +arrayBounds +arrayBoundsRead globalvariable.c strchr: @cd strchr; \ - $(LCLINTR) -f .lclintrc -booltype "lltX_bool" strchr.c + $(LCLINTR) +arrayBounds +arrayBoundsRead strchr.c for: @cd for; \ - $(LCLINTR) -f .lclintrc -booltype "lltX_bool" for.c + $(LCLINTR) +arrayBounds +arrayBoundsRead for.c tests2.5: setenv LCLINT '$(LCLINTRN)'; cd tests2.5 ; $(MAKE) -e diff --git a/test/abst_t.lcs b/test/abst_t.lcs index c4550e3..ced8c30 100644 --- a/test/abst_t.lcs +++ b/test/abst_t.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/abstptr.lcs b/test/abstptr.lcs index 844ef60..0d4f79b 100644 --- a/test/abstptr.lcs +++ b/test/abstptr.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/alias.lcs b/test/alias.lcs index 31f1965..d1f6aba 100644 --- a/test/alias.lcs +++ b/test/alias.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/alias2.lcs b/test/alias2.lcs index 936f48e..3ddc4e5 100644 --- a/test/alias2.lcs +++ b/test/alias2.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/alias3.lcs b/test/alias3.lcs index 6eaf761..da7944a 100644 --- a/test/alias3.lcs +++ b/test/alias3.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/alias3.lh b/test/alias3.lh index 3e4e989..83dec39 100644 --- a/test/alias3.lh +++ b/test/alias3.lh @@ -1,4 +1,4 @@ -/* Output from LCLint 3.0.0.8 */ +/* Output from LCLint 3.0.0.9 */ # include "bool.h" diff --git a/test/alias4.lcs b/test/alias4.lcs index e14f7f0..9041d55 100644 --- a/test/alias4.lcs +++ b/test/alias4.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/alias4.lh b/test/alias4.lh index 8a2391c..9713c68 100644 --- a/test/alias4.lh +++ b/test/alias4.lh @@ -1,4 +1,4 @@ -/* Output from LCLint 3.0.0.8 */ +/* Output from LCLint 3.0.0.9 */ # include "bool.h" # include "mut.h" diff --git a/test/alias5.lcs b/test/alias5.lcs index a3f265e..ac0ef5d 100644 --- a/test/alias5.lcs +++ b/test/alias5.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/alias5.lh b/test/alias5.lh index 87c840b..1151b4c 100644 --- a/test/alias5.lh +++ b/test/alias5.lh @@ -1,4 +1,4 @@ -/* Output from LCLint 3.0.0.8 */ +/* Output from LCLint 3.0.0.9 */ # include "bool.h" diff --git a/test/argorder2.lcs b/test/argorder2.lcs index de44360..664e3ce 100644 --- a/test/argorder2.lcs +++ b/test/argorder2.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/argorder4.lcs b/test/argorder4.lcs index 7313739..7b28e83 100644 --- a/test/argorder4.lcs +++ b/test/argorder4.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/args.lcs b/test/args.lcs index 35c3d68..57ed249 100644 --- a/test/args.lcs +++ b/test/args.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/bufferTest.expect b/test/bufferTest.expect index 4aeb1c3..4d59c0e 100644 --- a/test/bufferTest.expect +++ b/test/bufferTest.expect @@ -1,20 +1,21 @@ test4.c: (in function t) test4.c:6:3: Variable g used before definition -test4.c:6:3: Unresolved constraint: - Lclint is unable to resolve Requires: : MAXSET ((g @ test4.c:6:3 ) ) >= ( - 100 ) needed to satisfy Requires: : MAXSET ((g @ test4.c:6:3 ) ) >= ( - 100 ) +test4.c:6:3: Possible out-of-bounds store. Unable to resolve constraint: + requires: : maxSet ((g @ test4.c:6:3 ) ) >= ( 100 ) + needed to satisfy precondition: + 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: Unresolved constraint: - Lclint is unable to resolve Requires: : MAXSET ((g @ test6.c:5:4 ) ) >= ( - 1 ) needed to satisfy Requires: : MAXSET ((g @ test6.c:6:3 ) ) >= ( 0 ) -test6.c:6:10: Unresolved constraint: - Lclint is unable to resolve Requires: : MAXREAD ((g @ test6.c:5:4 ) ) >= - ( 2 ) needed to satisfy Requires: : MAXREAD ((g @ test6.c:6:10 ) ) >= ( - 1 ) +test6.c:6:3: Possible out-of-bounds store. Unable to resolve constraint: + requires: : maxSet ((g @ test6.c:5:4 ) ) >= ( 1 ) + needed to satisfy precondition: + 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 ) + needed to satisfy precondition: + requires: : maxRead ((g @ test6.c:6:10 ) ) >= ( 1 ) Finished LCLint checking --- 6 code errors found diff --git a/test/bufferTest.out b/test/bufferTest.out index 4aeb1c3..4d59c0e 100644 --- a/test/bufferTest.out +++ b/test/bufferTest.out @@ -1,20 +1,21 @@ test4.c: (in function t) test4.c:6:3: Variable g used before definition -test4.c:6:3: Unresolved constraint: - Lclint is unable to resolve Requires: : MAXSET ((g @ test4.c:6:3 ) ) >= ( - 100 ) needed to satisfy Requires: : MAXSET ((g @ test4.c:6:3 ) ) >= ( - 100 ) +test4.c:6:3: Possible out-of-bounds store. Unable to resolve constraint: + requires: : maxSet ((g @ test4.c:6:3 ) ) >= ( 100 ) + needed to satisfy precondition: + 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: Unresolved constraint: - Lclint is unable to resolve Requires: : MAXSET ((g @ test6.c:5:4 ) ) >= ( - 1 ) needed to satisfy Requires: : MAXSET ((g @ test6.c:6:3 ) ) >= ( 0 ) -test6.c:6:10: Unresolved constraint: - Lclint is unable to resolve Requires: : MAXREAD ((g @ test6.c:5:4 ) ) >= - ( 2 ) needed to satisfy Requires: : MAXREAD ((g @ test6.c:6:10 ) ) >= ( - 1 ) +test6.c:6:3: Possible out-of-bounds store. Unable to resolve constraint: + requires: : maxSet ((g @ test6.c:5:4 ) ) >= ( 1 ) + needed to satisfy precondition: + 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 ) + needed to satisfy precondition: + requires: : maxRead ((g @ test6.c:6:10 ) ) >= ( 1 ) Finished LCLint checking --- 6 code errors found diff --git a/test/cast.lcs b/test/cast.lcs index 8555fb8..3bd3a14 100644 --- a/test/cast.lcs +++ b/test/cast.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/db1/bool.lcs b/test/db1/bool.lcs index 2cac936..a6ab360 100644 --- a/test/db1/bool.lcs +++ b/test/db1/bool.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/db1/bool.lh b/test/db1/bool.lh index 3b2810c..5458a3b 100644 --- a/test/db1/bool.lh +++ b/test/db1/bool.lh @@ -1,4 +1,4 @@ -/* Output from LCLint 3.0.0.8 */ +/* Output from LCLint 3.0.0.9 */ # include "bool.h" diff --git a/test/db1/dbase.lcs b/test/db1/dbase.lcs index 041e4d5..2990998 100644 --- a/test/db1/dbase.lcs +++ b/test/db1/dbase.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/db1/dbase.lh b/test/db1/dbase.lh index 2555948..919a715 100644 --- a/test/db1/dbase.lh +++ b/test/db1/dbase.lh @@ -1,4 +1,4 @@ -/* Output from LCLint 3.0.0.8 */ +/* Output from LCLint 3.0.0.9 */ # include # include "bool.h" diff --git a/test/db1/employee.lcs b/test/db1/employee.lcs index b3571e4..dd6cff4 100644 --- a/test/db1/employee.lcs +++ b/test/db1/employee.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/db1/employee.lh b/test/db1/employee.lh index 934a3dc..f56b083 100644 --- a/test/db1/employee.lh +++ b/test/db1/employee.lh @@ -1,4 +1,4 @@ -/* Output from LCLint 3.0.0.8 */ +/* Output from LCLint 3.0.0.9 */ # include "bool.h" # include "bool.h" diff --git a/test/db1/empset.lcs b/test/db1/empset.lcs index 8701555..d06e7ea 100644 --- a/test/db1/empset.lcs +++ b/test/db1/empset.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/db1/empset.lh b/test/db1/empset.lh index 5655774..1de89d5 100644 --- a/test/db1/empset.lh +++ b/test/db1/empset.lh @@ -1,4 +1,4 @@ -/* Output from LCLint 3.0.0.8 */ +/* Output from LCLint 3.0.0.9 */ # include "bool.h" # include "employee.h" diff --git a/test/db1/erc.lcs b/test/db1/erc.lcs index 525dc5d..a57e1c2 100644 --- a/test/db1/erc.lcs +++ b/test/db1/erc.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/db1/erc.lh b/test/db1/erc.lh index 53e2fdf..40c9bea 100644 --- a/test/db1/erc.lh +++ b/test/db1/erc.lh @@ -1,4 +1,4 @@ -/* Output from LCLint 3.0.0.8 */ +/* Output from LCLint 3.0.0.9 */ # include "bool.h" # include "eref.h" diff --git a/test/db1/eref.lcs b/test/db1/eref.lcs index c310e47..e2ba300 100644 --- a/test/db1/eref.lcs +++ b/test/db1/eref.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/db1/eref.lh b/test/db1/eref.lh index b3aa26a..30c9423 100644 --- a/test/db1/eref.lh +++ b/test/db1/eref.lh @@ -1,4 +1,4 @@ -/* Output from LCLint 3.0.0.8 */ +/* Output from LCLint 3.0.0.9 */ # include "bool.h" # include "employee.h" diff --git a/test/db1/ereftab.lcs b/test/db1/ereftab.lcs index 6cbd720..dafa742 100644 --- a/test/db1/ereftab.lcs +++ b/test/db1/ereftab.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/db1/ereftab.lh b/test/db1/ereftab.lh index b5889f8..e12eb35 100644 --- a/test/db1/ereftab.lh +++ b/test/db1/ereftab.lh @@ -1,4 +1,4 @@ -/* Output from LCLint 3.0.0.8 */ +/* Output from LCLint 3.0.0.9 */ # include "bool.h" # include "employee.h" diff --git a/test/db2/dbase.lcs b/test/db2/dbase.lcs index 8a906ce..fdac799 100644 --- a/test/db2/dbase.lcs +++ b/test/db2/dbase.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/db2/dbase.lh b/test/db2/dbase.lh index 2555948..919a715 100644 --- a/test/db2/dbase.lh +++ b/test/db2/dbase.lh @@ -1,4 +1,4 @@ -/* Output from LCLint 3.0.0.8 */ +/* Output from LCLint 3.0.0.9 */ # include # include "bool.h" diff --git a/test/db2/employee.lcs b/test/db2/employee.lcs index 02300ee..ef85848 100644 --- a/test/db2/employee.lcs +++ b/test/db2/employee.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/db2/employee.lh b/test/db2/employee.lh index 0ca4bc2..8788f07 100644 --- a/test/db2/employee.lh +++ b/test/db2/employee.lh @@ -1,4 +1,4 @@ -/* Output from LCLint 3.0.0.8 */ +/* Output from LCLint 3.0.0.9 */ # include # include "bool.h" diff --git a/test/db2/empset.lcs b/test/db2/empset.lcs index 4a5dcd0..775b5b0 100644 --- a/test/db2/empset.lcs +++ b/test/db2/empset.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/db2/empset.lh b/test/db2/empset.lh index d1a9885..48c1065 100644 --- a/test/db2/empset.lh +++ b/test/db2/empset.lh @@ -1,4 +1,4 @@ -/* Output from LCLint 3.0.0.8 */ +/* Output from LCLint 3.0.0.9 */ # include "bool.h" # include "employee.h" diff --git a/test/db2/erc.lcs b/test/db2/erc.lcs index 9390c5c..aa70daf 100644 --- a/test/db2/erc.lcs +++ b/test/db2/erc.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/db2/erc.lh b/test/db2/erc.lh index 87aa6d5..b263cc0 100644 --- a/test/db2/erc.lh +++ b/test/db2/erc.lh @@ -1,4 +1,4 @@ -/* Output from LCLint 3.0.0.8 */ +/* Output from LCLint 3.0.0.9 */ # include "bool.h" # include "eref.h" diff --git a/test/db2/eref.lcs b/test/db2/eref.lcs index 8397afd..4ade37f 100644 --- a/test/db2/eref.lcs +++ b/test/db2/eref.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/db2/eref.lh b/test/db2/eref.lh index b3aa26a..30c9423 100644 --- a/test/db2/eref.lh +++ b/test/db2/eref.lh @@ -1,4 +1,4 @@ -/* Output from LCLint 3.0.0.8 */ +/* Output from LCLint 3.0.0.9 */ # include "bool.h" # include "employee.h" diff --git a/test/db2/ereftab.lcs b/test/db2/ereftab.lcs index 47ca5c4..f944c06 100644 --- a/test/db2/ereftab.lcs +++ b/test/db2/ereftab.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/db2/ereftab.lh b/test/db2/ereftab.lh index b5889f8..e12eb35 100644 --- a/test/db2/ereftab.lh +++ b/test/db2/ereftab.lh @@ -1,4 +1,4 @@ -/* Output from LCLint 3.0.0.8 */ +/* Output from LCLint 3.0.0.9 */ # include "bool.h" # include "employee.h" diff --git a/test/db3/bool.lcs b/test/db3/bool.lcs index 2cf1899..03d7197 100644 --- a/test/db3/bool.lcs +++ b/test/db3/bool.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/db3/bool.lh b/test/db3/bool.lh index 379f7ea..655b92c 100644 --- a/test/db3/bool.lh +++ b/test/db3/bool.lh @@ -1,4 +1,4 @@ -/* Output from LCLint 3.0.0.8 */ +/* Output from LCLint 3.0.0.9 */ # include "bool.h" diff --git a/test/db3/check.lcs b/test/db3/check.lcs index 90ee3bc..cf1cf5d 100644 --- a/test/db3/check.lcs +++ b/test/db3/check.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/db3/check.lh b/test/db3/check.lh index c78371f..3e770d1 100644 --- a/test/db3/check.lh +++ b/test/db3/check.lh @@ -1,4 +1,4 @@ -/* Output from LCLint 3.0.0.8 */ +/* Output from LCLint 3.0.0.9 */ # include "bool.h" # include "bool.h" diff --git a/test/db3/dbase.lcs b/test/db3/dbase.lcs index af4bc62..4c4145a 100644 --- a/test/db3/dbase.lcs +++ b/test/db3/dbase.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/db3/dbase.lh b/test/db3/dbase.lh index fe66110..3d2c923 100644 --- a/test/db3/dbase.lh +++ b/test/db3/dbase.lh @@ -1,4 +1,4 @@ -/* Output from LCLint 3.0.0.8 */ +/* Output from LCLint 3.0.0.9 */ # include # include "bool.h" diff --git a/test/db3/employee.lcs b/test/db3/employee.lcs index b25b66a..0975a16 100644 --- a/test/db3/employee.lcs +++ b/test/db3/employee.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/db3/employee.lh b/test/db3/employee.lh index c5d5aae..a9bc212 100644 --- a/test/db3/employee.lh +++ b/test/db3/employee.lh @@ -1,4 +1,4 @@ -/* Output from LCLint 3.0.0.8 */ +/* Output from LCLint 3.0.0.9 */ # include # include "bool.h" diff --git a/test/db3/empset.lcs b/test/db3/empset.lcs index cad11a6..4ffcf0f 100644 --- a/test/db3/empset.lcs +++ b/test/db3/empset.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/db3/empset.lh b/test/db3/empset.lh index 81ae002..192cc17 100644 --- a/test/db3/empset.lh +++ b/test/db3/empset.lh @@ -1,4 +1,4 @@ -/* Output from LCLint 3.0.0.8 */ +/* Output from LCLint 3.0.0.9 */ # include "bool.h" # include "employee.h" diff --git a/test/db3/erc.lcs b/test/db3/erc.lcs index 56c48a2..fc22bb3 100644 --- a/test/db3/erc.lcs +++ b/test/db3/erc.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/db3/erc.lh b/test/db3/erc.lh index 978d8a1..b22797c 100644 --- a/test/db3/erc.lh +++ b/test/db3/erc.lh @@ -1,4 +1,4 @@ -/* Output from LCLint 3.0.0.8 */ +/* Output from LCLint 3.0.0.9 */ # include "bool.h" # include "eref.h" diff --git a/test/db3/eref.lcs b/test/db3/eref.lcs index 08a9069..c0da6f7 100644 --- a/test/db3/eref.lcs +++ b/test/db3/eref.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/db3/eref.lh b/test/db3/eref.lh index 3af65f6..0e8fbe8 100644 --- a/test/db3/eref.lh +++ b/test/db3/eref.lh @@ -1,4 +1,4 @@ -/* Output from LCLint 3.0.0.8 */ +/* Output from LCLint 3.0.0.9 */ # include "bool.h" # include "employee.h" diff --git a/test/db3/ereftab.lcs b/test/db3/ereftab.lcs index 5944bb7..8b731a8 100644 --- a/test/db3/ereftab.lcs +++ b/test/db3/ereftab.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/db3/ereftab.lh b/test/db3/ereftab.lh index 4723bf9..b2c5ad1 100644 --- a/test/db3/ereftab.lh +++ b/test/db3/ereftab.lh @@ -1,4 +1,4 @@ -/* Output from LCLint 3.0.0.8 */ +/* Output from LCLint 3.0.0.9 */ # include "bool.h" # include "employee.h" diff --git a/test/decl2.lcs b/test/decl2.lcs index 66f7ce4..62db37a 100644 --- a/test/decl2.lcs +++ b/test/decl2.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/enum.lcs b/test/enum.lcs index a7ed218..0a4603f 100644 --- a/test/enum.lcs +++ b/test/enum.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/for.expect b/test/for.expect index 22aa76a..6209bae 100644 --- a/test/for.expect +++ b/test/for.expect @@ -1,8 +1,8 @@ for.c: (in function f) -for.c:13:5: Unresolved constraint: - Lclint is unable to resolve Requires: : (i @ for.c:13:7 ) <= ( 10 ) - needed to satisfy Requires: : MAXSET ((t @ for.c:13:5 ) ) >= (i @ - for.c:13:7 ) +for.c:13:5: Possible out-of-bounds store. Unable to resolve constraint: + requires: : (i @ for.c:13:7 ) <= ( 10 ) + needed to satisfy precondition: + requires: : maxSet ((t @ for.c:13:5 ) ) >= (i @ for.c:13:7 ) Finished LCLint checking --- 1 code error found diff --git a/test/for/.lclintrc b/test/for/.lclintrc index dd00d2e..84b3644 100644 --- a/test/for/.lclintrc +++ b/test/for/.lclintrc @@ -1 +1 @@ -+fcnconstraint ++arrayBounds diff --git a/test/glob.lcs b/test/glob.lcs index c04b17d..2ee1d2d 100644 --- a/test/glob.lcs +++ b/test/glob.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/impabstract.lcs b/test/impabstract.lcs index e553a35..94581be 100644 --- a/test/impabstract.lcs +++ b/test/impabstract.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/iter.lcs b/test/iter.lcs index c3ca7a6..031203f 100644 --- a/test/iter.lcs +++ b/test/iter.lcs @@ -1,4 +1,4 @@ -%FAILED Output from LCLint 3.0.0.8 +%FAILED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/macros.lcs b/test/macros.lcs index ac9b854..df02aab 100644 --- a/test/macros.lcs +++ b/test/macros.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/macrosef.lcs b/test/macrosef.lcs index cabe563..d207294 100644 --- a/test/macrosef.lcs +++ b/test/macrosef.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/maxset.expect b/test/maxset.expect index 3973259..9e473f1 100644 --- a/test/maxset.expect +++ b/test/maxset.expect @@ -2,11 +2,14 @@ Finished LCLint checking --- no code errors found maxsetnoannotations.c: (in function noancopy) -maxsetnoannotations.c:4:1: Unresolved constraint: - Lclint is unable to resolve Requires: : MAXSET ((a @ maxsetnoannotations.c:4 - :9 ) ) >= MAXREAD ((b @ maxsetnoannotations.c:4:11 ) ) needed to satisfy - Requires: : MAXSET ((a @ maxsetnoannotations.c:4:9 ) ) >= MAXREAD ((b @ - maxsetnoannotations.c:4:11 ) ) derived from strcpy precondition: Requires: - : MAXSET (( ) ) >= MAXREAD (( ) ) +maxsetnoannotations.c:4:1: Possible out-of-bounds store. Unable to resolve + constraint: + requires: : maxSet ((a @ maxsetnoannotations.c:4:9 ) ) >= maxRead ((b @ + maxsetnoannotations.c:4:11 ) ) + needed to satisfy precondition: + requires: : maxSet ((a @ maxsetnoannotations.c:4:9 ) ) >= maxRead ((b @ + maxsetnoannotations.c:4:11 ) ) + derived from strcpy precondition: requires: : + maxSet (( ) ) >= maxRead (( ) ) Finished LCLint checking --- 1 code error found diff --git a/test/maxset/.lclintrc b/test/maxset/.lclintrc index 7512d0f..3733a1e 100644 --- a/test/maxset/.lclintrc +++ b/test/maxset/.lclintrc @@ -1,2 +1,2 @@ -no-lib -+fcnconstraint ++arrayBounds diff --git a/test/modtest.lcs b/test/modtest.lcs index aaa0bcb..441a325 100644 --- a/test/modtest.lcs +++ b/test/modtest.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/moreBufferTests.expect b/test/moreBufferTests.expect index faf52ba..23697c1 100644 --- a/test/moreBufferTests.expect +++ b/test/moreBufferTests.expect @@ -3,32 +3,40 @@ unrecogCall.c: (in function foo) unrecogCall.c:8:3: Unrecognized identifier: bar initialization.c: (in function initialization) initialization.c:5:10: Variable g declared but not used -initialization.c:8:3: Unresolved constraint: - Lclint is unable to resolve Requires: : MAXSET ((d @ initialization.c:3:14 - ) ) >= ( 2 ) needed to satisfy Requires: : - MAXSET ((f @ initialization.c:8:3 ) ) >= ( 2 ) -initialization.c:5:14: Unresolved constraint: - Lclint is unable to resolve Requires: : MAXREAD ((d @ initialization.c:3:14 - ) ) >= ( 22 ) needed to satisfy Requires: : - MAXREAD ((e @ initialization.c:5:14 ) ) >= ( 22 ) +initialization.c:8:3: Possible out-of-bounds store. Unable to resolve + constraint: + requires: : maxSet ((d @ initialization.c:3:14 ) ) >= ( 2 ) + needed to satisfy precondition: + 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 ) + needed to satisfy precondition: + requires: : maxRead ((e @ initialization.c:5:14 ) ) >= ( 22 ) simplifyTest.c: (in function fooSub) -simplifyTest.c:3:3: Unresolved constraint: - Lclint is unable to resolve Requires: : MAXSET ((s @ simplifyTest.c:3:3 ) ) - >= (i @ simplifyTest.c:3:5 ) needed to satisfy Requires: : - MAXSET ((s @ simplifyTest.c:3:3 ) ) >= (i @ simplifyTest.c:3:5 ) +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 ) + needed to satisfy precondition: + requires: : maxSet ((s @ simplifyTest.c:3:3 ) ) >= (i @ + simplifyTest.c:3:5 ) simplifyTest.c: (in function fooAdd) -simplifyTest.c:10:3: Unresolved constraint: - Lclint is unable to resolve Requires: : MAXSET ((s @ simplifyTest.c:10:3 ) - ) >= ((i @ simplifyTest.c:10:5 ) ) + (( 2 ) ) needed to satisfy Requires: - : MAXSET ((s @ simplifyTest.c:10:3 ) ) >= ((i @ simplifyTest.c:10:5 ) ) + - (( 2 ) ) +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 ) ) + needed to satisfy precondition: + 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: Unresolved constraint: - Lclint is unable to resolve Requires: : - MAXREAD ((buffer @ strncatNotReallyGood.c:4:29 ) ) <= ( 0 ) needed to - satisfy Requires: : MAXSET ((buffer @ strncatNotReallyGood.c:4:29 ) ) >= - (MAXREAD ((buffer @ strncatNotReallyGood.c:4:29 ) )) + (( 255 ) ) +strncatNotReallyGood.c:4:21: Possible out-of-bounds store. Unable to resolve + constraint: + 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 ) ) Finished LCLint checking --- 8 code errors found diff --git a/test/mut.lcs b/test/mut.lcs index 8420ed1..7b55779 100644 --- a/test/mut.lcs +++ b/test/mut.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/mut.lh b/test/mut.lh index 3616b5d..1815e5c 100644 --- a/test/mut.lh +++ b/test/mut.lh @@ -1,4 +1,4 @@ -/* Output from LCLint 3.0.0.8 */ +/* Output from LCLint 3.0.0.9 */ # include "bool.h" diff --git a/test/null6.lcd b/test/null6.lcd index 532d27e..479cbb8 100644 --- a/test/null6.lcd +++ b/test/null6.lcd @@ -1,5 +1,5 @@ ;;LCLint Dump: null6.lcd -;;LCLint 3.0.0.8 --- 19 July 2001 +;;LCLint 3.0.0.9 --- 23 July 2001 ;;lib:168 ;;ctTable 0 u-2 19 38 diff --git a/test/null6.lcs b/test/null6.lcs index ae317b1..90c0a3a 100644 --- a/test/null6.lcs +++ b/test/null6.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/observer.lcs b/test/observer.lcs index 08f4c79..84c37f5 100644 --- a/test/observer.lcs +++ b/test/observer.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/oldstyle.lcs b/test/oldstyle.lcs index 1a03b0a..a0e95bf 100644 --- a/test/oldstyle.lcs +++ b/test/oldstyle.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/outglob.lcs b/test/outglob.lcs index 1cc122c..b3f0f0c 100644 --- a/test/outglob.lcs +++ b/test/outglob.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/outparam.lcs b/test/outparam.lcs index bcf37b3..e520adc 100644 --- a/test/outparam.lcs +++ b/test/outparam.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/repexpose.lcs b/test/repexpose.lcs index aadd27f..be48846 100644 --- a/test/repexpose.lcs +++ b/test/repexpose.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/repexpose.lh b/test/repexpose.lh index 6b4a0e7..ed3b216 100644 --- a/test/repexpose.lh +++ b/test/repexpose.lh @@ -1,4 +1,4 @@ -/* Output from LCLint 3.0.0.8 */ +/* Output from LCLint 3.0.0.9 */ # include "bool.h" diff --git a/test/simplebufferConstraintTests.expect b/test/simplebufferConstraintTests.expect index 6272fb8..6220f7c 100644 --- a/test/simplebufferConstraintTests.expect +++ b/test/simplebufferConstraintTests.expect @@ -3,25 +3,27 @@ m.c: (in function t) m.c:9:1: Index of possibly null pointer f: f m.c:8:5: Storage f may become null sizeof.c: (in function f) -sizeof.c:17:1: Unresolved constraint: - Lclint is unable to resolve Requires: : - ( 2 ) >= ( 3 ) needed to satisfy Requires: : MAXSET ((x @ sizeof.c:17:1 - ) ) >= ( 3 ) +sizeof.c:17:1: Possible out-of-bounds store. Unable to resolve constraint: + requires: : ( 2 ) >= ( 3 ) + needed to satisfy precondition: + 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: Unresolved constraint: - Lclint is unable to resolve Requires: : - ( 99 ) >= ( 101 ) needed to satisfy Requires: : MAXSET ((g @ - test3.c:9:3 ) ) >= ( 101 ) +test3.c:9:3: Possible out-of-bounds store. Unable to resolve constraint: + requires: : ( 99 ) >= ( 101 ) + needed to satisfy precondition: + 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:8:3: Unresolved constraint: - Lclint is unable to resolve Requires: : MAXSET ((j @ test7.c:8:3 ) ) >= ( - 0 ) needed to satisfy Requires: : MAXSET ((j @ test7.c:8:3 ) ) >= ( 0 ) -test7.c:6:3: Unresolved constraint: - Lclint is unable to resolve Requires: : MAXSET ((g @ test7.c:4:3 ) ) >= ( - 4 ) needed to satisfy 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 ) + needed to satisfy precondition: + requires: : maxSet ((j @ test7.c:8:3 ) ) >= ( 0 ) +test7.c:6:3: Possible out-of-bounds store. Unable to resolve constraint: + requires: : maxSet ((g @ test7.c:4:3 ) ) >= ( 4 ) + needed to satisfy precondition: + requires: : maxSet ((g @ test7.c:6:3 ) ) >= ( 2 ) Finished LCLint checking --- 7 code errors found diff --git a/test/sizeoftest.expect b/test/sizeoftest.expect index e9969c8..223775e 100644 --- a/test/sizeoftest.expect +++ b/test/sizeoftest.expect @@ -1,8 +1,8 @@ sizeof.c: (in function main) -sizeof.c:6:2: Unresolved constraint: - Lclint is unable to resolve Requires: : - ( 2 ) >= ( 3 ) needed to satisfy Requires: : MAXSET ((x @ sizeof.c:6:2 - ) ) >= ( 3 ) +sizeof.c:6:2: Possible out-of-bounds store. Unable to resolve constraint: + requires: : ( 2 ) >= ( 3 ) + needed to satisfy precondition: + requires: : maxSet ((x @ sizeof.c:6:2 ) ) >= ( 3 ) Finished LCLint checking --- 1 code error found diff --git a/test/sizeoftest.out b/test/sizeoftest.out index e9969c8..223775e 100644 --- a/test/sizeoftest.out +++ b/test/sizeoftest.out @@ -1,8 +1,8 @@ sizeof.c: (in function main) -sizeof.c:6:2: Unresolved constraint: - Lclint is unable to resolve Requires: : - ( 2 ) >= ( 3 ) needed to satisfy Requires: : MAXSET ((x @ sizeof.c:6:2 - ) ) >= ( 3 ) +sizeof.c:6:2: Possible out-of-bounds store. Unable to resolve constraint: + requires: : ( 2 ) >= ( 3 ) + needed to satisfy precondition: + requires: : maxSet ((x @ sizeof.c:6:2 ) ) >= ( 3 ) Finished LCLint checking --- 1 code error found diff --git a/test/special.lcs b/test/special.lcs index 8d4ebb4..8b84f10 100644 --- a/test/special.lcs +++ b/test/special.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/strchr/strchr.c b/test/strchr/strchr.c index 0f6f0e2..4c873d2 100644 --- a/test/strchr/strchr.c +++ b/test/strchr/strchr.c @@ -1,4 +1,4 @@ -#include "../../lib/ansi.h" + void func () { char *c; diff --git a/test/tests2.2/bool.lcs b/test/tests2.2/bool.lcs index 06fe076..d590718 100644 --- a/test/tests2.2/bool.lcs +++ b/test/tests2.2/bool.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/tests2.4/subdir/main.lcs b/test/tests2.4/subdir/main.lcs index 3e35e0d..839abfd 100644 --- a/test/tests2.4/subdir/main.lcs +++ b/test/tests2.4/subdir/main.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/tests2.5/newlint.lcd b/test/tests2.5/newlint.lcd index c94f7b5..022460c 100644 --- a/test/tests2.5/newlint.lcd +++ b/test/tests2.5/newlint.lcd @@ -1,5 +1,5 @@ ;;LCLint Dump: newlint.lcd -;;LCLint 3.0.0.8 --- 19 July 2001 +;;LCLint 3.0.0.9 --- 23 July 2001 ;;lib:168 ;;ctTable 0 u-2 19 38 diff --git a/test/tq.lcs b/test/tq.lcs index 5b180fa..a355c9b 100644 --- a/test/tq.lcs +++ b/test/tq.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil diff --git a/test/ud2.lcs b/test/ud2.lcs index 0b3efd8..7df0767 100644 --- a/test/ud2.lcs +++ b/test/ud2.lcs @@ -1,4 +1,4 @@ -%PASSED Output from LCLint 3.0.0.8 +%PASSED Output from LCLint 3.0.0.9 %LCLimports %LCLSortTable %LCLsort bool immutable nil nil -- 2.45.2