From 754e4dbd7787b6c32d1093961149887bc98a133d Mon Sep 17 00:00:00 2001 From: drl7x Date: Mon, 15 Jan 2001 02:11:38 +0000 Subject: [PATCH] Added new tests. --- test/Makefile | 26 +- test/bufferTest.expect | 10 +- test/db1.out | 691 +------------------------------------- test/db1/employee.lh | 2 +- test/db1/empset.lh | 2 +- test/db1/erc.lh | 2 +- test/db1/ereftab.lh | 2 +- test/db2.out | 169 +--------- test/db2/erc.lh | 2 +- test/db3.out | 146 +------- test/db3/dbase.lh | 2 +- test/db3/employee.lh | 2 +- test/db3/empset.lh | 2 +- test/db3/erc.lh | 2 +- test/db3/eref.lh | 2 +- test/db3/ereftab.lh | 2 +- test/funcpointer.out | 3 + test/maxset.expect | 12 + test/maxset.out | 12 + test/null6.lcd | 17 +- test/sizeoftest.expect | 6 +- test/sizeoftest.out | 6 +- test/strchr.expect | 6 + test/strchr.out | 6 + test/tests2.2a.out | 1 + test/tests2.5/newlint.lcd | 11 +- 26 files changed, 104 insertions(+), 1040 deletions(-) create mode 100644 test/maxset.expect create mode 100644 test/maxset.out create mode 100644 test/strchr.expect create mode 100644 test/strchr.out diff --git a/test/Makefile b/test/Makefile index 6c7d3d8..b46bd6e 100644 --- a/test/Makefile +++ b/test/Makefile @@ -24,6 +24,10 @@ .PHONY: sizeoftest .PHONY: bufferTest .PHONY: simplebufferConstraintTests +.PHONY: maxset +.PHONY: globalbufferannotation +.PHONY: strchr +.PHONY: for .SUFFIXES: .out .expect .c .lcl .h .lh .diff @@ -38,7 +42,7 @@ LCLINTP = $(LCLINT) LCLINTRN = $(LCLINTP) -nof -hints -booltype "bool" LCLINTR = $(LCLINTRN) -exportlocal -UNITTESTS = help abstptr abstract alias alttypes ansireserved argorder args blocks break cases cast charlit clauses commentchar compdestroy controldepth csyntax czechnames czechoslovaknames decl enum exports external fields flags funcpointer glob globals impabstract init inparam internal iter keep libs lintcomments list macros macrosef merge modifies modtest moduncon mongoincludes null sizeoftest bufferTest simplebufferConstraintTests observer oldstyle outglob outparam preds prefixes printflike rc refcounts release repexpose sharing slovaknames specclauses special stack staticarray strings structassign typequals ud ulstypes union unreachable unused tests2.2 tests2.2a tests2.4 tests2.5 +UNITTESTS = help sizeoftest bufferTest simplebufferConstraintTests globalbufferannotation maxset strchr for abstptr abstract alias alttypes ansireserved argorder args blocks break cases cast charlit clauses commentchar compdestroy controldepth csyntax czechnames czechoslovaknames decl enum exports external fields flags funcpointer glob globals impabstract init inparam internal iter keep libs lintcomments list macros macrosef merge modifies modtest moduncon mongoincludes null observer oldstyle outglob outparam preds prefixes printflike rc refcounts release repexpose sharing slovaknames specclauses special stack staticarray strings structassign typequals ud ulstypes union unreachable unused tests2.2 tests2.2a tests2.4 tests2.5 #UNITTEST = bufferTest @@ -595,6 +599,26 @@ simplebufferConstraintTests: @cd simplebufferConstraintTests; \ $(LCLINTR) +functionconstraint m.c sizeof.c test3.c test7.c +maxset: + @cd maxset; \ + $(LCLINTR) -f .lclintrc -booltype "lltX_bool" maxsetannotations.c; \ + pwd; \ + echo $(LCLINTR); \ + $(LCLINTR) -f .lclintrc -booltype "lltX_bool" maxsetnoannotations.c + +globalbufferannotation: + @cd globalbufferannotation; \ + $(LCLINTR) +functionconstraint globalvariable.c + + +strchr: + @cd strchr; \ + $(LCLINTR) -f .lclintrc -booltype "lltX_bool" strchr.c + +for: + @cd for; \ + $(LCLINTR) -f .lclintrc -booltype "lltX_bool" for.c + tests2.5: setenv LCLINT '$(LCLINTRN)'; cd tests2.5 ; $(MAKE) -e diff --git a/test/bufferTest.expect b/test/bufferTest.expect index 82827d2..3fbcc7a 100644 --- a/test/bufferTest.expect +++ b/test/bufferTest.expect @@ -3,18 +3,18 @@ test4.c: (in function t) test4.c:6:3: Variable g used before definition test4.c:15:2: Unresolved constraint: Lclint is unable to resolve Requires: : MAXSET ((g @ test4.c:6:3 ) ) >= ( - 100 ) needed to satisy Requires: : MAXSET ((g @ test4.c:6:3 ) ) >= ( 100 - ) + 100 ) needed to satisfy 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:7:2: Unresolved constraint: Lclint is unable to resolve Requires: : MAXSET ((g @ test6.c:5:4 ) ) >= ( - 1 ) needed to satisy Requires: : MAXSET ((g @ test6.c:6:3 ) ) >= ( 0 ) + 1 ) needed to satisfy Requires: : MAXSET ((g @ test6.c:6:3 ) ) >= ( 0 ) test6.c:7:2: Unresolved constraint: Lclint is unable to resolve Requires: : MAXREAD ((g @ test6.c:5:4 ) ) >= - ( 2 ) needed to satisy Requires: : MAXREAD ((g @ test6.c:6:10 ) ) >= ( 1 - ) + ( 2 ) needed to satisfy Requires: : MAXREAD ((g @ test6.c:6:10 ) ) >= ( + 1 ) Finished LCLint checking --- 6 code errors found diff --git a/test/db1.out b/test/db1.out index 1939926..c79007f 100644 --- a/test/db1.out +++ b/test/db1.out @@ -1,689 +1,2 @@ - -< reading spec bool.lcl > -< reading spec employee.lcl > -< reading spec eref.lcl > -< reading spec empset.lcl > -< reading spec ereftab.lcl > -< reading spec erc.lcl > -< reading spec dbase.lcl > -< preprocessing > -< checking employee.c > -employee.c: (in function employee_equal) -employee.c:24: Function strncmp expects arg 3 to be size_t gets int: - maxEmployeeName -< checking eref.c > -< checking empset.c > -empset.c: (in function empset_insert) -empset.c:28: Variable er declared but not used -empset.c: (in function empset_disjointUnion) -empset.c:85: Undocumented modification of s1 possible from call to - erc_iterStart (through alias s2): erc_iterStart(s2) -empset.c:85: Undocumented modification of s2 possible from call to - erc_iterStart: erc_iterStart(s2) -empset.c: (in function empset_union) -empset.c:108: Undocumented modification of s2 possible from call to - erc_iterStart (through alias s1): erc_iterStart(s1) -empset.c:108: Undocumented modification of s1 possible from call to - erc_iterStart: erc_iterStart(s1) -empset.c: (in function empset_subset) -empset.c:139: Undocumented modification of s1 possible from call to - erc_iterStart: erc_iterStart(s1) -empset.c:135: Variable e declared but not used -< checking ereftab.c > -ereftab.c: (in function ereftab_lookup) -ereftab.c:34: Undocumented modification of t possible from call to - erc_iterStart: erc_iterStart(t) -< checking erc.c > -erc.c: (in function erc_member) -erc.c:47: Operands of == are abstract type (eref): tmpc->val == er -erc.c: (in function erc_delete) -erc.c:78: Operands of == are abstract type (eref): elem->val == er -erc.c: (in function erc_sprint) -erc.c:141: Function malloc expects arg 1 to be size_t gets int: - erc_size(c) * (employeePrintSize + 1) + 1 -erc.c:151: Undocumented modification of c possible from call to erc_iterStart: - erc_iterStart(c) -< checking dbase.c > -dbase.c: (in function query) -dbase.c:210: Variable er declared but not used -dbase.c:211: Variable e declared but not used -< checking drive.c > -drive.c: (in function main) -drive.c:123: Return value (type db_status) ignored: hire(e) -< checking macros bool.h > -< global checks > -< cleaning .......... > - -Finished LCLint checking --- 16 code errors found, as expected - -< reading spec bool.lcl > -< reading spec employee.lcl > -< reading spec eref.lcl > -< reading spec empset.lcl > -< reading spec ereftab.lcl > -< reading spec erc.lcl > -< reading spec dbase.lcl > -< preprocessing > -employee.h:2: Name EMPLOYEE_H is reserved for future ANSI library extensions. - Macros beginning with E and a digit or uppercase letter may be added to - . (See ANSI, Section 4.13.1) -< more preprocessing . > -eref.h:2: Name EREF_H is reserved for future ANSI library extensions. Macros - beginning with E and a digit or uppercase letter may be added to . - (See ANSI, Section 4.13.1) -< more preprocessing . > -empset.h:2: Name EMPSET_H is reserved for future ANSI library extensions. - Macros beginning with E and a digit or uppercase letter may be added to - . (See ANSI, Section 4.13.1) -< more preprocessing . > -erc.h:2: Name ERC_H is reserved for future ANSI library extensions. Macros - beginning with E and a digit or uppercase letter may be added to . - (See ANSI, Section 4.13.1) -< more preprocessing . > -ereftab.h:4: Name EREFTAB_H is reserved for future ANSI library extensions. - Macros beginning with E and a digit or uppercase letter may be added to - . (See ANSI, Section 4.13.1) -< more preprocessing . > -< checking employee.c > -bool.h:20: Modifies list for bool_initMod uses global internal state, not - included in globals list. - bool.h:20: Declaration of bool_initMod -employee.c: (in function employee_setName) -employee.c:11: Body of if statement is not a block: return FALSE -employee.c:14: Parameter 1 (e->name) to function strcpy is declared unique but - may be aliased externally by parameter 2 (na) -employee.c: (in function employee_equal) -employee.c:24: Function strncmp expects arg 3 to be size_t gets int: - maxEmployeeName -employee.c: (in function employee_sprint) -employee.c:29: Read-only string literal storage used as initial value for - unqualified storage: gender[0] = "male" -employee.c:29: Read-only string literal storage used as initial value for - unqualified storage: gender[1] = "female" -employee.c:29: Read-only string literal storage used as initial value for - unqualified storage: gender[2] = "?" -employee.c:30: Read-only string literal storage used as initial value for - unqualified storage: jobs[0] = "manager" -employee.c:30: Read-only string literal storage used as initial value for - unqualified storage: jobs[1] = "non-manager" -employee.c:30: Read-only string literal storage used as initial value for - unqualified storage: jobs[2] = "?" -employee.c:33: Array fetch using non-integer, gender: gender[e.gen] -employee.c:33: Array fetch using non-integer, job: jobs[e.j] -employee.h: (in macro employee_initMod) -employee.h:10: Called procedure bool_initMod may access internal state, but - globals list does not include globals internalState -employee.h:10: Undocumented modification of internal state possible from call - to bool_initMod: bool_initMod() -< checking eref.c > -eref.h:9: Constant exported, but not specified: used -eref.h:9: Constant exported, but not specified: avail -eref.h:9: Type exported, but not specified: eref_status -eref.h:14: Type exported, but not specified: eref_ERP -eref.h:17: Variable exported, but not specified: eref_Pool -eref.c: (in function eref_alloc) -eref.c:12: Undocumented use of global eref_Pool -eref.c:12: Undocumented use of global eref_Pool -eref.c:12: Body of for statement is empty -eref.c:12: Undocumented use of global eref_Pool (in post loop test) -eref.c:16: Undocumented use of global eref_Pool -eref.c:18: Undocumented use of global eref_Pool -eref.c:19: Undocumented use of global eref_Pool -eref.c:20: Undocumented use of global eref_Pool -eref.c:20: Parameter to sizeof is type employee: sizeof(employee) -eref.c:19: Undocumented modification of *(eref_Pool.conts) possible from call - to realloc: realloc(eref_Pool.conts, 2 * eref_Pool.size * sizeof(employee)) -eref.c:18: Undocumented modification of eref_Pool.conts: - eref_Pool.conts = (employee *)realloc(eref_Pool.conts, 2 * eref_Pool.size * - sizeof(employee)) -eref.c:22: Undocumented use of global eref_Pool -eref.c:25: Argument to exit has implementation defined behavior: 1 -eref.c:28: Undocumented use of global eref_Pool -eref.c:29: Undocumented use of global eref_Pool -eref.c:30: Undocumented use of global eref_Pool -eref.c:30: Parameter to sizeof is type eref_status: sizeof(eref_status) -eref.c:29: Undocumented modification of *(eref_Pool.status) possible from call - to realloc: realloc(eref_Pool.status, 2 * eref_Pool.size * - sizeof(eref_status)) -eref.c:28: Undocumented modification of eref_Pool.status: - eref_Pool.status = (eref_status *)realloc(eref_Pool.status, 2 * - eref_Pool.size * sizeof(eref_status)) -eref.c:32: Undocumented use of global eref_Pool -eref.c:35: Argument to exit has implementation defined behavior: 1 -eref.c:38: Undocumented use of global eref_Pool -eref.c:38: Undocumented use of global eref_Pool -eref.c:38: Undocumented modification of eref_Pool.size: - eref_Pool.size = 2 * eref_Pool.size -eref.c:40: Undocumented use of global eref_Pool -eref.c:41: Undocumented use of global eref_Pool -eref.c:41: Undocumented modification of eref_Pool.status[]: - eref_Pool.status[i] = avail -eref.c:41: Body of for statement is not a block: eref_Pool.status[i] = avail -eref.c:41: Undocumented use of global eref_Pool (in post loop test) -eref.c:44: Undocumented use of global eref_Pool -eref.c:44: Undocumented modification of eref_Pool.status[]: - eref_Pool.status[res] = used -eref.c: (in function eref_initMod) -eref.c:53: Undocumented use of file static needsInit -eref.c:58: Undocumented use of file static needsInit -eref.c:58: Undocumented modification of needsInit: needsInit = FALSE -eref.c:60: Statement has no effect: employee_initMod() -eref.c:62: Undocumented use of global eref_Pool -eref.c:62: Parameter to sizeof is type employee: sizeof(employee) -eref.c:62: Undocumented modification of eref_Pool.conts: - eref_Pool.conts = (employee *)malloc(size * sizeof(employee)) -eref.c:62: Implicitly only storage eref_Pool.conts not released before - assignment: eref_Pool.conts = (employee *)malloc(size * sizeof(employee)) -eref.c:64: Undocumented use of global eref_Pool -eref.c:67: Argument to exit has implementation defined behavior: 1 -eref.c:70: Undocumented use of global eref_Pool -eref.c:70: Parameter to sizeof is type eref_status: sizeof(eref_status) -eref.c:70: Undocumented modification of eref_Pool.status: - eref_Pool.status = (eref_status *)malloc(size * sizeof(eref_status)) -eref.c:70: Implicitly only storage eref_Pool.status not released before - assignment: eref_Pool.status = (eref_status *)malloc(size * - sizeof(eref_status)) -eref.c:72: Undocumented use of global eref_Pool -eref.c:75: Argument to exit has implementation defined behavior: 1 -eref.c:78: Undocumented use of global eref_Pool -eref.c:78: Undocumented modification of eref_Pool.size: eref_Pool.size = size -eref.c:82: Undocumented use of global eref_Pool -eref.c:82: Undocumented modification of eref_Pool.status[]: - eref_Pool.status[i] = avail -eref.c:84: Global storage *(eref_Pool.conts) contains 4 undefined fields when - call returns: ssNum, salary, gen, j -eref.c:84: Global storage eref_Pool contains 1 undefined field when call - returns: status -eref.h: (in macro eref_free) -eref.h:23: Undocumented use of global eref_Pool -eref.h:23: Undocumented modification of eref_Pool.status[]: - eref_Pool.status[er] = avail -eref.h: (in macro eref_assign) -eref.h:24: Undocumented use of global eref_Pool -eref.h:24: Macro parameter used without parentheses: e -eref.h:24: Undocumented modification of eref_Pool.conts[]: - eref_Pool.conts[er] = e -eref.h: (in macro eref_get) -eref.h:25: Undocumented use of global eref_Pool -eref.h: (in macro eref_equal) -eref.h:26: Macro parameter used without parentheses: er1 -eref.h:26: Macro parameter used without parentheses: er2 -< checking empset.c > -erc.h:6: Type exported, but not specified: ercElem -erc.h:7: Type exported, but not specified: ercList -erc.h:8: Type exported, but not specified: ercInfo -empset.h:10: Variable exported, but not specified: known -empset.c:5: Name _empset_get is in the implementation name space (any - identifier beginning with underscore) -empset.c: (in function _empset_get) -empset.c:11: Undocumented modification of s possible from call to - erc_iterStart: erc_iterStart(s) -empset.c:15: Body of if statement is not a block: - do { { erc_iterFinal(it) } } while (FALSE) -empset.c: (in function empset_insert) -empset.c:30: Undetected modification possible from call to unconstrained - function _empset_get: _empset_get -empset.c:28: Variable er declared but not used -empset.c: (in function empset_insertUnique) -empset.c:43: Undocumented use of global known -empset.c:49: Undocumented use of global known -empset.c:49: Undocumented modification of known possible from call to - ereftab_insert: ereftab_insert(known, e, er) -empset.c: (in function empset_delete) -empset.c:59: Undetected modification possible from call to unconstrained - function _empset_get: _empset_get -empset.c: (in function empset_disjointUnion) -empset.c:85: Undocumented modification of s1 possible from call to - erc_iterStart (through alias s2): erc_iterStart(s2) -empset.c:85: Undocumented modification of s2 possible from call to - erc_iterStart: erc_iterStart(s2) -empset.c:86: Body of for statement is not a block: - empset_insertUnique(result, eref_get(er)) -empset.c: (in function empset_union) -empset.c:108: Undocumented modification of s2 possible from call to - erc_iterStart (through alias s1): erc_iterStart(s1) -empset.c:108: Undocumented modification of s1 possible from call to - erc_iterStart: erc_iterStart(s1) -empset.c:110: Body of if statement is not a block: erc_insert(result, er) -empset.c:109: Body of for statement is not a block: - if (!empset_member(eref_get(er), s2)) erc_insert(result, er) -empset.c: (in function empset_intersect) -empset.c:125: Body of if statement is not a block: erc_insert(toDelete, er) -empset.c:124: Body of for statement is not a block: - if (!empset_member(eref_get(er), s2)) erc_insert(toDelete, er) -empset.c:128: Return value (type bool) ignored: erc_delete(s1, er) -empset.c:128: Body of for statement is not a block: erc_delete(s1, er) -empset.c: (in function empset_subset) -empset.c:139: Undocumented modification of s1 possible from call to - erc_iterStart: erc_iterStart(s1) -empset.c:141: Body of if statement is not a block: - do { { erc_iterFinal(it) } } while (FALSE) -empset.c:140: Body of for statement is not a block: - if (!empset_member(eref_get(er), s2)) do { { erc_iterFinal(it) - } } while (FALSE) -empset.c:135: Variable e declared but not used -empset.c: (in function empset_initMod) -empset.c:148: Undocumented use of file static initDone -empset.c:148: Body of if statement is not a block: return -empset.c:151: Statement has no effect: employee_initMod() -empset.c:153: Statement has no effect: erc_initMod() -empset.c:154: Statement has no effect: ereftab_initMod() -empset.c:155: Undocumented use of global known -empset.c:155: Undocumented modification of known: known = ereftab_create() -empset.c:156: Undocumented use of file static initDone -empset.c:156: Undocumented modification of initDone: initDone = TRUE -empset.h: (in macro empset_member) -empset.h:30: Undetected modification possible from call to unconstrained - function _empset_get: _empset_get -< checking ereftab.c > -ereftab.c: (in function ereftab_delete) -ereftab.c:24: Return value (type bool) ignored: erc_delete(t, er) -ereftab.c: (in function ereftab_lookup) -ereftab.c:34: Undocumented modification of t possible from call to - erc_iterStart: erc_iterStart(t) -ereftab.c:37: Body of if statement is not a block: return er -ereftab.c: (in function ereftab_initMod) -ereftab.c:47: Statement has no effect: erc_initMod() -< checking erc.c > -erc.c: (in function erc_create) -erc.c:8: Parameter to sizeof is type ercInfo: sizeof(ercInfo) -erc.c:13: Argument to exit has implementation defined behavior: 1 -erc.c:18: Null storage c->vals derivable from return value: c - erc.c:16: Storage c->vals becomes null -erc.c:18: Fresh storage returned as unqualified (should be only): c - erc.c:8: Fresh storage c allocated -erc.c: (in function erc_clear) -erc.c:34: Function returns with null storage derivable from parameter c->vals - erc.c:32: Storage c->vals becomes null -erc.c: (in function erc_final) -erc.c:39: Implicitly temp storage c passed as only param: free (c) -erc.c: (in function erc_member) -erc.c:47: Operands of == are abstract type (eref): tmpc->val == er -erc.c:47: Body of if statement is not a block: return TRUE -erc.c:47: Body of for statement is not a block: - if (tmpc->val == er) return TRUE -erc.c: (in function erc_insert) -erc.c:55: Parameter to sizeof is type ercElem: sizeof(ercElem) -erc.c:60: Argument to exit has implementation defined behavior: 1 -erc.c: (in function erc_delete) -erc.c:78: Operands of == are abstract type (eref): elem->val == er -erc.c:83: Implicitly only storage prev->next not released before assignment: - prev->next = elem->next -erc.c:83: Clauses exit with elem referencing implicitly only storage in true - branch, local storage in false branch - erc.c:81: Storage elem becomes implicitly only -erc.c:83: Storage c->vals->next is kept in one path, but live in another. - erc.c:83: Storage c->vals->next becomes kept -erc.c:81: Body of if clause of if statement is not a block: - c->vals = elem->next -erc.c:83: Body of else clause of if statement is not a block: - prev->next = elem->next -erc.c:87: Released storage c->vals reachable from parameter at return point - erc.c:85: Storage c->vals is released -erc.c: (in function erc_iterStart) -erc.c:98: Parameter to sizeof is type ercList: sizeof(ercList) -erc.c:103: Argument to exit has implementation defined behavior: 1 -erc.c:107: Fresh storage returned as unqualified (should be only): result - erc.c:98: Fresh storage result allocated -erc.c:108: Suspect object listed in modifies of erc_iterStart not modified: c - erc.lcl:49: Specification of erc_iterStart -erc.c: (in function erc_yield) -erc.c:117: Implicitly temp storage it passed as only param: free (it) -erc.c:117: Unreachable code: free(it) -erc.c:118: Variable it is released in true branch, but live in continuation. - erc.c:117: Storage it is released -erc.c:121: Only storage *it->next assigned to unqualified: *(it) = (*it)->next -erc.c: (in function erc_join) -erc.c:130: Body of for statement is not a block: erc_insert(c1, tmpc->val) -erc.c: (in function erc_sprint) -erc.c:141: Function malloc expects arg 1 to be size_t gets int: - erc_size(c) * (employeePrintSize + 1) + 1 -erc.c:146: Argument to exit has implementation defined behavior: 1 -erc.c:151: Undocumented modification of c possible from call to erc_iterStart: - erc_iterStart(c) -erc.c:159: Fresh storage returned as unqualified (should be only): result - erc.c:140: Fresh storage result allocated -erc.h: (in macro erc_choose) -erc.h:15: Macro parameter used without parentheses: c -erc.h: (in macro erc_initMod) -erc.h:16: Called procedure bool_initMod may access internal state, but globals - list does not include globals internalState -erc.h:16: Undocumented modification of internal state possible from call to - bool_initMod: bool_initMod() -erc.h:16: Statement has no effect: employee_initMod() -erc.h: (in macro erc_iterFinal) -erc.h:20: Implicitly temp storage it passed as only param: free (it) -< checking dbase.c > -dbase.c: (in function db_initMod) -dbase.c:21: Undocumented use of global initDone -dbase.c:27: Statement has no effect: employee_initMod() -dbase.c:29: Statement has no effect: erc_initMod() -dbase.c:30: Statement has no effect: empset_initMod() -dbase.c:32: Assignment of enum { mMGRS, fMGRS, mNON, fNON } to int: i = mMGRS -dbase.c:32: Operands of <= have incompatible types (int, enum { mMGRS, fMGRS, - mNON, fNON }): i <= fNON -dbase.c:34: Undocumented use of global db -dbase.c:34: Undocumented modification of db[]: db[i] = erc_create() -dbase.c:32: Incompatible types for <= (int, enum { mMGRS, fMGRS, mNON, fNON }) - (in post loop test): i <= fNON -dbase.c:37: Undocumented use of global initDone -dbase.c:37: Undocumented modification of initDone: initDone = TRUE -dbase.c:40: Name _db_ercKeyGet is in the implementation name space (any - identifier beginning with underscore) -dbase.c: (in function _db_ercKeyGet) -dbase.c:45: Undocumented modification of c possible from call to erc_iterStart: - erc_iterStart(c) -dbase.c:56: Name _db_keyGet is in the implementation name space (any identifier - beginning with underscore) -dbase.c: (in function _db_keyGet) -dbase.c:61: Assignment of enum { mMGRS, fMGRS, mNON, fNON } to int: i = mMGRS -dbase.c:61: Operands of <= have incompatible types (int, enum { mMGRS, fMGRS, - mNON, fNON }): i <= fNON -dbase.c:63: Undocumented use of global db -dbase.c:63: Undetected modification possible from call to unconstrained - function _db_ercKeyGet: _db_ercKeyGet -dbase.c:61: Incompatible types for <= (int, enum { mMGRS, fMGRS, mNON, fNON }) - (in post loop test): i <= fNON -dbase.c:73: Name _db_addEmpls is in the implementation name space (any - identifier beginning with underscore) -dbase.c: (in function _db_addEmpls) -dbase.c:81: Undocumented modification of c possible from call to erc_iterStart: - erc_iterStart(c) -dbase.c:86: Undocumented modification of s possible from call to empset_insert: - empset_insert(s, e) -dbase.c:86: Return value (type bool) ignored: empset_insert(s, e) -dbase.c: (in function hire) -dbase.c:97: Body of if statement is not a block: return genderERR -dbase.c:100: Body of if statement is not a block: return jobERR -dbase.c:103: Body of if statement is not a block: return salERR -dbase.c:105: Undetected modification possible from call to unconstrained - function _db_keyGet: _db_keyGet -dbase.c:106: Body of if statement is not a block: return duplERR -dbase.c: (in function uncheckedHire) -dbase.c:121: Undocumented use of global db -dbase.c:121: Array fetch using non-integer, enum { mMGRS, fMGRS, mNON, fNON }: - db[mMGRS] -dbase.c:121: Undocumented modification of db[] possible from call to - erc_insert: erc_insert(db[mMGRS], er) -dbase.c:123: Undocumented use of global db -dbase.c:123: Array fetch using non-integer, enum { mMGRS, fMGRS, mNON, fNON }: - db[mNON] -dbase.c:123: Undocumented modification of db[] possible from call to - erc_insert: erc_insert(db[mNON], er) -dbase.c:121: Body of if clause of if statement is not a block: - erc_insert(db[mMGRS], er) -dbase.c:123: Body of else clause of if statement is not a block: - erc_insert(db[mNON], er) -dbase.c:126: Undocumented use of global db -dbase.c:126: Array fetch using non-integer, enum { mMGRS, fMGRS, mNON, fNON }: - db[fMGRS] -dbase.c:126: Undocumented modification of db[] possible from call to - erc_insert: erc_insert(db[fMGRS], er) -dbase.c:128: Undocumented use of global db -dbase.c:128: Array fetch using non-integer, enum { mMGRS, fMGRS, mNON, fNON }: - db[fNON] -dbase.c:128: Undocumented modification of db[] possible from call to - erc_insert: erc_insert(db[fNON], er) -dbase.c:126: Body of if clause of if statement is not a block: - erc_insert(db[fMGRS], er) -dbase.c:128: Body of else clause of if statement is not a block: - erc_insert(db[fNON], er) -dbase.c:123: Body of if clause of if statement is not a block: - if (e.j == MGR) erc_insert(db[mMGRS], er) else erc_insert(db[mNON], er) -dbase.c: (in function fire) -dbase.c:137: Assignment of enum { mMGRS, fMGRS, mNON, fNON } to int: i = mMGRS -dbase.c:137: Operands of <= have incompatible types (int, enum { mMGRS, fMGRS, - mNON, fNON }): i <= fNON -dbase.c:138: Undocumented use of global db -dbase.c:138: Undocumented modification of db[] possible from call to - erc_iterStart: erc_iterStart(db[i]) -dbase.c:142: Undocumented use of global db -dbase.c:142: Undocumented modification of db[] possible from call to - erc_delete: erc_delete(db[i], er) -dbase.c:142: Return value (type bool) ignored: erc_delete(db[i]... -dbase.c:139: Body of for statement is not a block: - if (eref_get(er).ssNum == ssNum) { erc_iterFinal(it) } -dbase.c:139: Body of for statement is not a block: - for (er = erc_yield(it = erc_iterStart(db[i])); !eref_equal(er, erefNIL); - er = erc_yield(it)) if (eref_get(er).ssNum == ssNum) { erc_iterFinal(it) } -dbase.c:137: Incompatible types for <= (int, enum { mMGRS, fMGRS, mNON, fNON }) - (in post loop test): i <= fNON -dbase.c: (in function promote) -dbase.c:156: Undocumented use of global db -dbase.c:156: Array fetch using non-integer, enum { mMGRS, fMGRS, mNON, fNON }: - db[mNON] -dbase.c:156: Undetected modification possible from call to unconstrained - function _db_ercKeyGet: _db_ercKeyGet -dbase.c:160: Undocumented use of global db -dbase.c:160: Array fetch using non-integer, enum { mMGRS, fMGRS, mNON, fNON }: - db[fNON] -dbase.c:160: Undetected modification possible from call to unconstrained - function _db_ercKeyGet: _db_ercKeyGet -dbase.c:162: Body of if statement is not a block: return FALSE -dbase.c:172: Undocumented use of global db -dbase.c:172: Array fetch using non-integer, enum { mMGRS, fMGRS, mNON, fNON }: - db[mNON] -dbase.c:172: Undocumented modification of db[] possible from call to - erc_delete: erc_delete(db[mNON], er) -dbase.c:172: Return value (type bool) ignored: erc_delete(db[mN... -dbase.c:173: Undocumented use of global db -dbase.c:173: Array fetch using non-integer, enum { mMGRS, fMGRS, mNON, fNON }: - db[mMGRS] -dbase.c:173: Undocumented modification of db[] possible from call to - erc_insert: erc_insert(db[mMGRS], er) -dbase.c:177: Undocumented use of global db -dbase.c:177: Array fetch using non-integer, enum { mMGRS, fMGRS, mNON, fNON }: - db[fNON] -dbase.c:177: Undocumented modification of db[] possible from call to - erc_delete: erc_delete(db[fNON], er) -dbase.c:177: Return value (type bool) ignored: erc_delete(db[fN... -dbase.c:178: Undocumented use of global db -dbase.c:178: Array fetch using non-integer, enum { mMGRS, fMGRS, mNON, fNON }: - db[fMGRS] -dbase.c:178: Undocumented modification of db[] possible from call to - erc_insert: erc_insert(db[fMGRS], er) -dbase.c: (in function setSalary) -dbase.c:194: Undetected modification possible from call to unconstrained - function _db_keyGet: _db_keyGet -dbase.c: (in function query) -dbase.c:226: Assignment of enum { mMGRS, fMGRS, mNON, fNON } to int: i = mMGRS -dbase.c:226: Operands of <= have incompatible types (int, enum { mMGRS, fMGRS, - mNON, fNON }): i <= fNON -dbase.c:227: Undocumented use of global db -dbase.c:227: Undetected modification possible from call to unconstrained - function _db_addEmpls: _db_addEmpls -dbase.c:227: Body of for statement is not a block: - numAdded += _db_addEmpls(db[i], l, h, s) -dbase.c:226: Incompatible types for <= (int, enum { mMGRS, fMGRS, mNON, fNON }) - (in post loop test): i <= fNON -dbase.c:230: Undocumented use of global db -dbase.c:230: Array fetch using non-integer, enum { mMGRS, fMGRS, mNON, fNON }: - db[mMGRS] -dbase.c:230: Undetected modification possible from call to unconstrained - function _db_addEmpls: _db_addEmpls -dbase.c:231: Undocumented use of global db -dbase.c:231: Array fetch using non-integer, enum { mMGRS, fMGRS, mNON, fNON }: - db[fMGRS] -dbase.c:231: Undetected modification possible from call to unconstrained - function _db_addEmpls: _db_addEmpls -dbase.c:234: Undocumented use of global db -dbase.c:234: Array fetch using non-integer, enum { mMGRS, fMGRS, mNON, fNON }: - db[mNON] -dbase.c:234: Undetected modification possible from call to unconstrained - function _db_addEmpls: _db_addEmpls -dbase.c:235: Undocumented use of global db -dbase.c:235: Array fetch using non-integer, enum { mMGRS, fMGRS, mNON, fNON }: - db[fNON] -dbase.c:235: Undetected modification possible from call to unconstrained - function _db_addEmpls: _db_addEmpls -dbase.c:242: Undocumented use of global db -dbase.c:242: Array fetch using non-integer, enum { mMGRS, fMGRS, mNON, fNON }: - db[mMGRS] -dbase.c:242: Undetected modification possible from call to unconstrained - function _db_addEmpls: _db_addEmpls -dbase.c:243: Undocumented use of global db -dbase.c:243: Array fetch using non-integer, enum { mMGRS, fMGRS, mNON, fNON }: - db[mNON] -dbase.c:243: Undetected modification possible from call to unconstrained - function _db_addEmpls: _db_addEmpls -dbase.c:246: Undocumented use of global db -dbase.c:246: Array fetch using non-integer, enum { mMGRS, fMGRS, mNON, fNON }: - db[mMGRS] -dbase.c:246: Undetected modification possible from call to unconstrained - function _db_addEmpls: _db_addEmpls -dbase.c:248: Undocumented use of global db -dbase.c:248: Array fetch using non-integer, enum { mMGRS, fMGRS, mNON, fNON }: - db[mNON] -dbase.c:248: Undetected modification possible from call to unconstrained - function _db_addEmpls: _db_addEmpls -dbase.c:254: Undocumented use of global db -dbase.c:254: Array fetch using non-integer, enum { mMGRS, fMGRS, mNON, fNON }: - db[fMGRS] -dbase.c:254: Undetected modification possible from call to unconstrained - function _db_addEmpls: _db_addEmpls -dbase.c:255: Undocumented use of global db -dbase.c:255: Array fetch using non-integer, enum { mMGRS, fMGRS, mNON, fNON }: - db[fNON] -dbase.c:255: Undetected modification possible from call to unconstrained - function _db_addEmpls: _db_addEmpls -dbase.c:258: Undocumented use of global db -dbase.c:258: Array fetch using non-integer, enum { mMGRS, fMGRS, mNON, fNON }: - db[fMGRS] -dbase.c:258: Undetected modification possible from call to unconstrained - function _db_addEmpls: _db_addEmpls -dbase.c:260: Undocumented use of global db -dbase.c:260: Array fetch using non-integer, enum { mMGRS, fMGRS, mNON, fNON }: - db[fNON] -dbase.c:260: Undetected modification possible from call to unconstrained - function _db_addEmpls: _db_addEmpls -dbase.c:210: Variable er declared but not used -dbase.c:211: Variable e declared but not used -dbase.c:263: Suspect object listed in modifies of query not modified: s - dbase.lcl:49: Specification of query -dbase.c: (in function db_print) -dbase.c:272: Assignment of enum { mMGRS, fMGRS, mNON, fNON } to int: i = mMGRS -dbase.c:272: Operands of <= have incompatible types (int, enum { mMGRS, fMGRS, - mNON, fNON }): i <= fNON -dbase.c:274: Undocumented use of global db -dbase.c:272: Incompatible types for <= (int, enum { mMGRS, fMGRS, mNON, fNON }) - (in post loop test): i <= fNON -< checking drive.c > -drive.c: (in function main) -drive.c:22: Statement has no effect: employee_initMod() -drive.c:23: Statement has no effect: empset_initMod() -drive.c:48: Return value (type bool) ignored: employee_setName... -drive.c:49: Return value (type bool) ignored: empset_insert(em... -drive.c:64: Return value (type bool) ignored: employee_setName... -drive.c:65: Return value (type bool) ignored: empset_delete(em... -drive.c:82: Return value (type bool) ignored: employee_setName... -drive.c:83: Return value (type bool) ignored: empset_insert(em... -drive.c:107: Return value (type bool) ignored: empset_delete(em... -drive.c:116: Body of if clause of if statement is not a block: e.gen = MALE -drive.c:116: Body of else clause of if statement is not a block: e.gen = FEMALE -drive.c:117: Body of if clause of if statement is not a block: e.j = NONMGR -drive.c:117: Body of else clause of if statement is not a block: e.j = MGR -drive.c:119: Return value (type bool) ignored: employee_setName... -drive.c:123: Return value (type db_status) ignored: hire(e) -drive.c:127: Assignment of db_status to int: j = hire(e) -drive.c:131: Variable j used before definition -drive.c:134: Return value (type bool) ignored: fire(17) -drive.c:158: Return value (type bool) ignored: fire(empset_choo... -drive.c:11: Parameter argv not used -< checking macros bool.h > -< global checks > -dbase.c:11: Type employeeKinds declared but not used -eref.lh:8: Function exported but not used outside eref: eref_free - eref.h:23: Definition of eref_free -empset.lh:8: Function exported but not used outside empset: empset_final - empset.h:29: Definition of empset_final -empset.lh:9: Function exported but not used outside empset: empset_clear - empset.c:24: Definition of empset_clear -empset.lh:11: Function exported but not used outside empset: - empset_insertUnique - empset.c:53: Definition of empset_insertUnique -empset.lh:17: Function exported but not used outside empset: empset_member - empset.h:30: Definition of empset_member -empset.lh:18: Function exported but not used outside empset: empset_subset - empset.c:144: Definition of empset_subset -ereftab.lh:10: Function exported but not used outside ereftab: ereftab_delete - ereftab.c:26: Definition of ereftab_delete -dbase.c:13: Variable exported but not used outside dbase: db -dbase.lh:27: Function exported but not used outside dbase: promote - dbase.c:182: Definition of promote -dbase.lh:28: Function exported but not used outside dbase: setSalary - dbase.c:206: Definition of setSalary -empset.h:10: Variable exported but not used outside empset: known -dbase.c:15: Variable exported but not used outside dbase: initDone -dbase.c:40: Function exported but not used outside dbase: _db_ercKeyGet - dbase.c:54: Definition of _db_ercKeyGet -dbase.c:56: Function exported but not used outside dbase: _db_keyGet - dbase.c:71: Definition of _db_keyGet -dbase.c:73: Function exported but not used outside dbase: _db_addEmpls - dbase.c:92: Definition of _db_addEmpls -dbase.c:13: Variable db exported but not declared in header file -empset.c:5: Function _empset_get exported but not declared in header file - empset.c:19: Definition of _empset_get -dbase.c:15: Variable initDone exported but not declared in header file -dbase.c:40: Function _db_ercKeyGet exported but not declared in header file - dbase.c:54: Definition of _db_ercKeyGet -dbase.c:56: Function _db_keyGet exported but not declared in header file - dbase.c:71: Definition of _db_keyGet -dbase.c:73: Function _db_addEmpls exported but not declared in header file - dbase.c:92: Definition of _db_addEmpls -< cleaning .......... > - -Error Type Reported Suppressed -=================== ======== ========= -abstract 2 0 -mayaliasunique 1 0 -exitarg 8 0 -unreachable 1 0 -forempty 1 0 -forblock 11 0 -ifblock 24 0 -usedef 1 0 -noeffect 11 0 -exporttype 5 0 -exportvar 2 0 -exportconst 2 0 -globs 64 1 -internalglobs 2 0 -warnmissingglobs 1 6 -retvalother 1 0 -retvalbool 16 0 -macroparens 4 0 -usereleased 1 0 -compdef 2 0 -mustfree 3 0 -branchstate 3 2 -onlytrans 1 0 -freshtrans 3 0 -temptrans 3 2 -readonlytrans 6 0 -mods 38 0 -mustmod 2 0 -modfilesys 0 25 -modnomods 4 0 -moduncon 20 0 -modunconnomods 1 0 -ansireserved 9 0 -fcnpost 0 54 -fcnconstraint 0 5 -nullret 1 0 -nullstate 1 0 -sizeoftype 7 0 -formalarray 0 17 -type 1 0 -enumindex 24 0 -relaxtypes 15 0 -matchanyintegral 2 0 -exportlocal 15 0 -exportheader 4 0 -exportheadervar 2 0 -paramuse 1 0 -typeuse 1 0 -varuse 4 0 - ======== ========= -Total 331 112 - -Finished LCLint checking --- 331 code errors found, as expected +dbase.lcl:2:1: Cannot find standard import file: stdio.lcs +*** Cannot continue. diff --git a/test/db1/employee.lh b/test/db1/employee.lh index e201551..e1fbc26 100644 --- a/test/db1/employee.lh +++ b/test/db1/employee.lh @@ -1,4 +1,4 @@ -/* Output from LCLint 2.5p */ +/* Output from LCLint 2.5q */ # include "bool.h" # include "bool.h" diff --git a/test/db1/empset.lh b/test/db1/empset.lh index 1104ded..099660b 100644 --- a/test/db1/empset.lh +++ b/test/db1/empset.lh @@ -1,4 +1,4 @@ -/* Output from LCLint 2.5p */ +/* Output from LCLint 2.5q */ # include "bool.h" # include "employee.h" diff --git a/test/db1/erc.lh b/test/db1/erc.lh index c3a3c94..6395967 100644 --- a/test/db1/erc.lh +++ b/test/db1/erc.lh @@ -1,4 +1,4 @@ -/* Output from LCLint 2.5p */ +/* Output from LCLint 2.5q */ # include "bool.h" # include "eref.h" diff --git a/test/db1/ereftab.lh b/test/db1/ereftab.lh index 5142bff..a43fcb7 100644 --- a/test/db1/ereftab.lh +++ b/test/db1/ereftab.lh @@ -1,4 +1,4 @@ -/* Output from LCLint 2.5p */ +/* Output from LCLint 2.5q */ # include "bool.h" # include "employee.h" diff --git a/test/db2.out b/test/db2.out index 9ad7275..64c29c1 100644 --- a/test/db2.out +++ b/test/db2.out @@ -1,169 +1,4 @@ < reading spec employee.lcl > -< reading spec eref.lcl > -< reading spec empset.lcl > -< reading spec ereftab.lcl > -< reading spec erc.lcl > -< reading spec dbase.lcl > -< preprocessing > -< checking employee.c > -employee.c: (in function employee_setName) -employee.c:14: Parameter 1 (e->name) to function strcpy is declared unique but - may be aliased externally by parameter 2 (na) -< checking eref.c > -eref.c: (in function eref_alloc) -eref.c:19: Unqualified storage eref_Pool.conts passed as only param: - realloc (eref_Pool.conts, ...) -eref.c:29: Unqualified storage eref_Pool.status passed as only param: - realloc (eref_Pool.status, ...) -eref.c:45: Storage eref_Pool.status reachable from global is only (should be - unqualified) - eref.c:30: Storage eref_Pool.status becomes only -eref.c:45: Storage eref_Pool.conts reachable from global is only (should be - unqualified) - eref.c:20: Storage eref_Pool.conts becomes only -eref.c: (in function eref_initMod) -eref.c:84: Storage eref_Pool.conts reachable from global is fresh (should be - unqualified) - eref.c:62: Fresh storage eref_Pool.conts allocated -eref.c:84: Global storage *(eref_Pool.conts) contains 4 undefined fields when - call returns: ssNum, salary, gen, j -eref.c:84: Storage eref_Pool.status reachable from global is fresh (should be - unqualified) - eref.c:70: Fresh storage eref_Pool.status allocated -eref.c:84: Global storage eref_Pool contains 1 undefined field when call - returns: status -< checking empset.c > -< checking ereftab.c > -< checking erc.c > -erc.c: (in function erc_create) -erc.c:33: Null storage c->vals derivable from return value: c - erc.c:31: Storage c->vals becomes null -erc.c:33: Fresh storage returned as unqualified (should be only): c - erc.c:23: Fresh storage c allocated -erc.c: (in function erc_clear) -erc.c:49: Function returns with null storage derivable from parameter c->vals - erc.c:47: Storage c->vals becomes null -erc.c: (in function erc_final) -erc.c:54: Implicitly temp storage c passed as only param: free (c) -erc.c: (in function erc_delete) -erc.c:102: Released storage c->vals reachable from parameter at return point - erc.c:100: Storage c->vals is released -erc.c: (in function erc_sprint) -erc.c:141: Fresh storage returned as unqualified (should be only): result - erc.c:122: Fresh storage result allocated -< checking dbase.c > -< checking drive.c > -< checking macros bool.h > -< global checks > - -Finished LCLint checking --- 15 code errors found, as expected - -< reading spec employee.lcl > -< reading spec eref.lcl > -< reading spec empset.lcl > -< reading spec ereftab.lcl > -< reading spec erc.lcl > -< reading spec dbase.lcl > -< preprocessing > -< checking employee.c > -employee.c: (in function employee_setName) -employee.c:14: Parameter 1 (e->name) to function strcpy is declared unique but - may be aliased externally by parameter 2 (na) -< checking eref.c > -eref.c: (in function eref_initMod) -eref.c:62: Implicitly only storage eref_Pool.conts not released before - assignment: eref_Pool.conts = (employee *)malloc(size * sizeof(employee)) -eref.c:70: Implicitly only storage eref_Pool.status not released before - assignment: eref_Pool.status = (eref_status *)malloc(size * - sizeof(eref_status)) -eref.c:84: Global storage *(eref_Pool.conts) contains 4 undefined fields when - call returns: ssNum, salary, gen, j -eref.c:84: Global storage eref_Pool contains 1 undefined field when call - returns: status -< checking empset.c > -empset.c: (in function empset_insertUnique) -empset.c:44: Clauses exit with er referencing fresh storage in true branch, - local storage in continuation - empset.c:41: Fresh storage er allocated -empset.c: (in function empset_intersect) -empset.c:126: Fresh storage toDelete not released before return - empset.c:112: Fresh storage toDelete allocated -< checking ereftab.c > -< checking erc.c > -erc.c: (in function erc_create) -erc.c:33: Null storage c->vals derivable from return value: c - erc.c:31: Storage c->vals becomes null -erc.c: (in function erc_clear) -erc.c:49: Function returns with null storage derivable from parameter c->vals - erc.c:47: Storage c->vals becomes null -erc.c: (in function erc_final) -erc.c:54: Implicitly temp storage c passed as only param: free (c) -erc.c: (in function erc_delete) -erc.c:98: Implicitly only storage prev->next not released before assignment: - prev->next = elem->next -erc.c:98: Clauses exit with elem referencing implicitly only storage in true - branch, local storage in false branch - erc.c:96: Storage elem becomes implicitly only -erc.c:98: Storage c->vals->next is kept in one path, but live in another. - erc.c:98: Storage c->vals->next becomes kept -erc.c:102: Released storage c->vals reachable from parameter at return point - erc.c:100: Storage c->vals is released -< checking dbase.c > -dbase.c: (in function uncheckedHire) -dbase.c:121: Fresh storage er not released before return - dbase.c:108: Fresh storage er allocated -< checking drive.c > -drive.c: (in function main) -drive.c:49: Variable m_res name is not a macro variable (it is a local - variable), but matches the macro variable namespace prefix "m_" -drive.c:65: Variable m_res name is not a macro variable (it is a local - variable), but matches the macro variable namespace prefix "m_" -drive.c:83: Variable m_res name is not a macro variable (it is a local - variable), but matches the macro variable namespace prefix "m_" -drive.c:120: Variable m_res name is not a macro variable (it is a local - variable), but matches the macro variable namespace prefix "m_" -drive.c:124: Variable m_res name is not a macro variable (it is a local - variable), but matches the macro variable namespace prefix "m_" -drive.c:135: Variable m_res name is not a macro variable (it is a local - variable), but matches the macro variable namespace prefix "m_" -drive.c:140: Fresh storage em1 not released before assignment: - em1 = empset_create() - drive.c:35: Fresh storage em1 allocated -drive.c:146: Fresh storage em2 not released before assignment: - em2 = empset_create() - drive.c:74: Fresh storage em2 allocated -drive.c:147: Fresh storage em3 not released before assignment: - em3 = empset_disjointUnion(em2, em1) - drive.c:87: Fresh storage em3 allocated -drive.c:159: Variable m_res name is not a macro variable (it is a local - variable), but matches the macro variable namespace prefix "m_" -drive.c:163: Fresh storage em1 not released before return - drive.c:140: Fresh storage em1 allocated -drive.c:163: Fresh storage em2 not released before return - drive.c:146: Fresh storage em2 allocated -drive.c:163: Fresh storage em3 not released before return - drive.c:147: Fresh storage em3 allocated -< checking macros bool.h > -< global checks > - -Finished LCLint checking --- 28 code errors found, as expected - -< reading spec employee.lcl > -< reading spec eref.lcl > -< reading spec empset.lcl > -< reading spec ereftab.lcl > -< reading spec erc.lcl > -< reading spec dbase.lcl > -< preprocessing > -< checking employee.c > -< checking eref.c > -< checking empset.c > -< checking ereftab.c > -< checking erc.c > -< checking dbase.c > -< checking drive.c > -< checking macros bool.h > -< global checks > - -Finished LCLint checking --- no code errors found +employee.lcl:2: Cannot find standard import file: stdio.lcs +*** Cannot continue. diff --git a/test/db2/erc.lh b/test/db2/erc.lh index 8105c22..9089a05 100644 --- a/test/db2/erc.lh +++ b/test/db2/erc.lh @@ -1,4 +1,4 @@ -/* Output from LCLint 2.5p */ +/* Output from LCLint 2.5q */ # include "bool.h" # include "eref.h" diff --git a/test/db3.out b/test/db3.out index e9a24c5..027b8c5 100644 --- a/test/db3.out +++ b/test/db3.out @@ -1,145 +1,3 @@ - -Error Type Reported Suppressed -=================== ======== ========= -usedef 0 1 -exporttype 0 3 -compdef 0 1 -modfilesys 0 25 -fcnpost 0 53 -fcnconstraint 0 4 -formalarray 0 17 - ======== ========= -Total 0 104 - -Finished LCLint checking --- no code errors found - -eref.c: (in function eref_alloc) -eref.c:36: Called procedure printf may access global stdout -eref.c:36: Undocumented modification of *stdout possible from call to printf: - printf("Malloc returned null in eref_alloc\n") -eref.c:36: Return value (type int) ignored: printf("Malloc r... -eref.c:46: Called procedure printf may access global stdout -eref.c:46: Undocumented modification of *stdout possible from call to printf: - printf("Malloc returned null in eref_alloc\n") -eref.c:46: Return value (type int) ignored: printf("Malloc r... -eref.c: (in function eref_initMod) -eref.c:82: Called procedure printf may access global stdout -eref.c:82: Undocumented modification of *stdout possible from call to printf: - printf("Malloc returned null in eref_initMod\n") -eref.c:82: Return value (type int) ignored: printf("Malloc r... -eref.c:90: Called procedure printf may access global stdout -eref.c:90: Undocumented modification of *stdout possible from call to printf: - printf("Malloc returned null in eref_initMod\n") -eref.c:90: Return value (type int) ignored: printf("Malloc r... -erc.c: (in function int_toSize) -erc.c:11: Undocumented use of global stderr -erc.c:11: Undocumented modification of *stderr possible from call to fprintf: - fprintf(stderr, "Error: int_toSize failure: %d", x) -erc.c:11: Return value (type int) ignored: fprintf(stderr, ... -erc.c: (in function erc_create) -erc.c:28: Called procedure printf may access global stdout -erc.c:28: Undocumented modification of *stdout possible from call to printf: - printf("Malloc returned null in erc_create\n") -erc.c:28: Return value (type int) ignored: printf("Malloc r... -erc.c: (in function erc_insert) -erc.c:80: Called procedure printf may access global stdout -erc.c:80: Undocumented modification of *stdout possible from call to printf: - printf("Malloc returned null in erc_insert\n") -erc.c:80: Return value (type int) ignored: printf("Malloc r... -erc.c: (in function erc_sprint) -erc.c:145: Called procedure printf may access global stdout -erc.c:145: Undocumented modification of *stdout possible from call to printf: - printf("Malloc returned null in erc_sprint\n") -erc.c:145: Return value (type int) ignored: printf("Malloc r... -dbase.c: (in function db_print) -dbase.c:307: Return value (type int) ignored: printf("Employee... -dbase.c:312: Return value (type int) ignored: printf("%s", pri... -drive.c: (in function main) -drive.c:31: Called procedure printf may access global stdout -drive.c:31: Undocumented modification of *stdout possible from call to printf: - printf("FormatPos: Wrong number of arguments. Given %d needs 0.\n", argc - - 1) -drive.c:31: Return value (type int) ignored: printf("FormatPo... -drive.c:41: Called procedure printf may access global stdout -drive.c:41: Undocumented modification of *stdout possible from call to printf: - printf("Size should be 0.\n") -drive.c:41: Return value (type int) ignored: printf("Size sho... -drive.c:57: Called procedure printf may access global stdout -drive.c:57: Undocumented modification of *stdout possible from call to printf: - printf("Size should be 500.\n") -drive.c:57: Return value (type int) ignored: printf("Size sho... -drive.c:73: Called procedure printf may access global stdout -drive.c:73: Undocumented modification of *stdout possible from call to printf: - printf("Size should be 250.\n") -drive.c:73: Return value (type int) ignored: printf("Size sho... -drive.c:93: Called procedure printf may access global stdout -drive.c:93: Undocumented modification of *stdout possible from call to printf: - printf("Size should be 350.\n") -drive.c:93: Return value (type int) ignored: printf("Size sho... -drive.c:100: Called procedure printf may access global stdout -drive.c:100: Undocumented modification of *stdout possible from call to printf: - printf("Size should be 350.\n") -drive.c:100: Return value (type int) ignored: printf("Size sho... -drive.c:103: Called procedure printf may access global stdout -drive.c:103: Undocumented modification of *stdout possible from call to printf: - printf("Print two different employees:\n") -drive.c:103: Return value (type int) ignored: printf("Print tw... -drive.c:109: Called procedure printf may access global stdout -drive.c:109: Undocumented modification of *stdout possible from call to printf: - printf("%s\n", &(na[0])) -drive.c:109: Return value (type int) ignored: printf("%s\n", &... -drive.c:151: Called procedure printf may access global stdout -drive.c:151: Undocumented modification of *stdout possible from call to printf: - printf("Should print true: %s\n", bool_unparse(status == DBS_DUPLERR)) -drive.c:151: Return value (type int) ignored: printf("Should p... -drive.c:154: Called procedure printf may access global stdout -drive.c:154: Undocumented modification of *stdout possible from call to printf: - printf("Employees 0 - 19\n") -drive.c:154: Return value (type int) ignored: printf("Employee... -drive.c:155: Called procedure db_print may access global stdout -drive.c:155: Undocumented modification of *stdout possible from call to - db_print: db_print() -drive.c:158: Called procedure printf may access global stdout -drive.c:158: Undocumented modification of *stdout possible from call to printf: - printf("Employees 0 - 16, 18 - 19\n") -drive.c:158: Return value (type int) ignored: printf("Employee... -drive.c:159: Called procedure db_print may access global stdout -drive.c:159: Undocumented modification of *stdout possible from call to - db_print: db_print() -drive.c:164: Called procedure printf may access global stdout -drive.c:164: Undocumented modification of *stdout possible from call to printf: - printf("Should get two females: %d\n%s\n", i, sprintResult) -drive.c:164: Return value (type int) ignored: printf("Should g... -drive.c:174: Called procedure printf may access global stdout -drive.c:174: Undocumented modification of *stdout possible from call to printf: - printf("Should get two females and ten males: %d\n%s\n", i, sprintResult) -drive.c:174: Return value (type int) ignored: printf("Should g... -drive.c:180: Called procedure printf may access global stdout -drive.c:180: Undocumented modification of *stdout possible from call to printf: - printf("Should get two females: %d\n%s\n", i, sprintResult) -drive.c:180: Return value (type int) ignored: printf("Should g... -drive.c:184: Called procedure printf may access global stdout -drive.c:184: Undocumented modification of *stdout possible from call to printf: - printf("Should get 18 employees\n") -drive.c:184: Return value (type int) ignored: printf("Should g... -drive.c:185: Called procedure db_print may access global stdout -drive.c:185: Undocumented modification of *stdout possible from call to - db_print: db_print() - -Error Type Reported Suppressed -=================== ======== ========= -usedef 0 1 -exporttype 0 3 -globs 26 0 -retvalint 25 0 -compdef 0 1 -mods 26 0 -modfilesys 0 25 -fcnpost 0 53 -fcnconstraint 0 4 -formalarray 0 17 - ======== ========= -Total 77 104 - -Finished LCLint checking --- 77 code errors found, as expected +employee.lcl:2: Cannot find standard import file: stdio.lcs +*** Cannot continue. diff --git a/test/db3/dbase.lh b/test/db3/dbase.lh index 0bfec40..a54d63b 100644 --- a/test/db3/dbase.lh +++ b/test/db3/dbase.lh @@ -1,4 +1,4 @@ -/* Output from LCLint 2.5p */ +/* Output from LCLint 2.5q */ # include # include "bool.h" diff --git a/test/db3/employee.lh b/test/db3/employee.lh index 54cd8f4..b8dd981 100644 --- a/test/db3/employee.lh +++ b/test/db3/employee.lh @@ -1,4 +1,4 @@ -/* Output from LCLint 2.5p */ +/* Output from LCLint 2.5q */ # include # include "bool.h" diff --git a/test/db3/empset.lh b/test/db3/empset.lh index 4a7ba7b..d5656bb 100644 --- a/test/db3/empset.lh +++ b/test/db3/empset.lh @@ -1,4 +1,4 @@ -/* Output from LCLint 2.5p */ +/* Output from LCLint 2.5q */ # include "bool.h" # include "employee.h" diff --git a/test/db3/erc.lh b/test/db3/erc.lh index d4011bc..8f67d93 100644 --- a/test/db3/erc.lh +++ b/test/db3/erc.lh @@ -1,4 +1,4 @@ -/* Output from LCLint 2.5p */ +/* Output from LCLint 2.5q */ # include "bool.h" # include "eref.h" diff --git a/test/db3/eref.lh b/test/db3/eref.lh index 8d28611..e42cd16 100644 --- a/test/db3/eref.lh +++ b/test/db3/eref.lh @@ -1,4 +1,4 @@ -/* Output from LCLint 2.5p */ +/* Output from LCLint 2.5q */ # include "bool.h" # include "employee.h" diff --git a/test/db3/ereftab.lh b/test/db3/ereftab.lh index 50bcca2..fffce7e 100644 --- a/test/db3/ereftab.lh +++ b/test/db3/ereftab.lh @@ -1,4 +1,4 @@ -/* Output from LCLint 2.5p */ +/* Output from LCLint 2.5q */ # include "bool.h" # include "employee.h" diff --git a/test/funcpointer.out b/test/funcpointer.out index 33be783..2b88b1d 100644 --- a/test/funcpointer.out +++ b/test/funcpointer.out @@ -28,5 +28,8 @@ funcpointer.c:48:10: Function (t6) called with 0 args, expects 2 funcpointer.c:49:10: Function (t6) called with 1 args, expects 2 funcpointer.c:50:11: Function (t6) called with 1 args, expects 2 funcpointer.c:50:10: Function ((t6)(3)) called with 0 args, expects 1 +uentry.c:579 [funcpointer.c:54:2]: >> called uentry_getFcnPreconditions on nonfunction f2 t2 +uentry.c:583 [funcpointer.c:54:2]: >> called uentry_getFcnPreconditions on nonfunction f2 t2 +uentry.c:633 [funcpointer.c:54:2]: >> called uentry_getFcnPostconditions on nonfunction f2 t2 Finished LCLint checking --- 18 code errors found, as expected diff --git a/test/maxset.expect b/test/maxset.expect new file mode 100644 index 0000000..eed7b16 --- /dev/null +++ b/test/maxset.expect @@ -0,0 +1,12 @@ + +Finished LCLint checking --- no code errors found +/a/apollo.cs.Virginia.EDU/af9/drl7x/re/LCLintDev/test/maxset + +maxsetnoannotations.c: (in function noancopy) +maxsetnoannotations.c:5:2: 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 ) ) + +Finished LCLint checking --- 1 code error found diff --git a/test/maxset.out b/test/maxset.out new file mode 100644 index 0000000..eed7b16 --- /dev/null +++ b/test/maxset.out @@ -0,0 +1,12 @@ + +Finished LCLint checking --- no code errors found +/a/apollo.cs.Virginia.EDU/af9/drl7x/re/LCLintDev/test/maxset + +maxsetnoannotations.c: (in function noancopy) +maxsetnoannotations.c:5:2: 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 ) ) + +Finished LCLint checking --- 1 code error found diff --git a/test/null6.lcd b/test/null6.lcd index 339dc5a..08298af 100644 --- a/test/null6.lcd +++ b/test/null6.lcd @@ -60,7 +60,7 @@ 2 y17|17& 2 y18|18& -2 ?! -0 a2|& +0 s2|& 0 s3|& 0 s4|& 0 s5|& @@ -659,7 +659,6 @@ 0 a1|& 0 s14|& ;;tistable -2 0 0,17 17 @@ -674,7 +673,7 @@ *0 (Datatype) 0@+@=@0@7@0@0@67#mbstate_t 0@+@+@0@7@0@0@654#mnull -2@+@-@0@0@0@0@2#lltX_bool +2@-@-@0@0@0@0@2#lltX_bool 13@-@-@0@0@0@0@59#__SIZE_TYPE__ 13@-@-@0@0@0@0@60#__PTRDIFF_TYPE__ 13@-@-@0@0@0@0@61#__WCHAR_TYPE__ @@ -697,8 +696,8 @@ 372@-@-@0@0@0@0@374#ldiv_t *1 (Constant) 0@i0@0@6#NULL -2@i1@0@0#TRUE 2$#NDEBUG +2@i1@0@0#TRUE 2@i0@0@6#FALSE 3$#UCHAR_MAX#UCHAR_MIN 4$#CHAR_MAX#CHAR_MIN#SCHAR_MAX#SCHAR_MIN @@ -763,8 +762,8 @@ 423$@0@s3,g125@0@0@1@s3,tg125$@0#vwprintf 388$@0@s3@1@s3,tp1$@0#fputws 434$@1@@1@s0$@0#wcscmp#wcscoll -499@6@0@1@1@0@1@g125@0@0,g113@0@0@1@g113,tg125$@0#wprintf 501@6@0@1@2@0@1@g124@0@0,g113@0@0@1@g113,tg124$@0#wscanf +499@6@0@1@1@0@1@g125@0@0,g113@0@0@1@g113,tg125$@0#wprintf 265$@0@s3,g113@0@0@1@s3,tp1,g113$@0#fputc#ungetc 276$@0@s3@1@s3,tp1$@0#putc 364$@1@@1@s0$@0#abs @@ -782,8 +781,8 @@ 344$@0@s1@1@s1$@0#atexit 405$@1@@1@s0$@0#mbsinit 278$@1@g125@0@0,s3@1@s3,tg125$@0#putchar -271$@1@g124@0@0,s3@1@s3,tg124$@0#getchar 321$@0@s1@1@s1$@0#rand +271$@1@g124@0@0,s3@1@s3,tg124$@0#getchar 317$@0@g113@0@0@1@tp1,g113$@0#strtol 477$@0@@1@tp1$@0#wcstol 371$@1@@1@s0$@0#labs @@ -890,8 +889,6 @@ 630@442#@tm 118@119#@lconv ;; Modules access -lltX_bool#1@ -types#1@ -ansi#9@ -null6#11@ +ansi#8@ +null6#10@ ;;End diff --git a/test/sizeoftest.expect b/test/sizeoftest.expect index 535b163..ab87310 100644 --- a/test/sizeoftest.expect +++ b/test/sizeoftest.expect @@ -1,8 +1,8 @@ sizeof.c: (in function main) sizeof.c:9:2: Unresolved constraint: - Lclint is unable to resolve Requires: : MAXSET ((x @ sizeof.c:6:2 ) ) >= - ( 3 ) needed to satisfy Requires: : MAXSET ((x @ sizeof.c:6:2 ) ) >= ( 3 - ) + Lclint is unable to resolve Requires: : + ( 2 ) >= ( 3 ) needed to satisfy 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 535b163..ab87310 100644 --- a/test/sizeoftest.out +++ b/test/sizeoftest.out @@ -1,8 +1,8 @@ sizeof.c: (in function main) sizeof.c:9:2: Unresolved constraint: - Lclint is unable to resolve Requires: : MAXSET ((x @ sizeof.c:6:2 ) ) >= - ( 3 ) needed to satisfy Requires: : MAXSET ((x @ sizeof.c:6:2 ) ) >= ( 3 - ) + Lclint is unable to resolve Requires: : + ( 2 ) >= ( 3 ) needed to satisfy Requires: : MAXSET ((x @ sizeof.c:6:2 + ) ) >= ( 3 ) Finished LCLint checking --- 1 code error found diff --git a/test/strchr.expect b/test/strchr.expect new file mode 100644 index 0000000..f54bbeb --- /dev/null +++ b/test/strchr.expect @@ -0,0 +1,6 @@ + +strchr.c: (in function func) +strchr.c:6:4: Dereference of possibly null pointer c: *c + strchr.c:5:7: Storage c may become null + +Finished LCLint checking --- 1 code error found diff --git a/test/strchr.out b/test/strchr.out new file mode 100644 index 0000000..f54bbeb --- /dev/null +++ b/test/strchr.out @@ -0,0 +1,6 @@ + +strchr.c: (in function func) +strchr.c:6:4: Dereference of possibly null pointer c: *c + strchr.c:5:7: Storage c may become null + +Finished LCLint checking --- 1 code error found diff --git a/test/tests2.2a.out b/test/tests2.2a.out index 1f957e8..64e412d 100644 --- a/test/tests2.2a.out +++ b/test/tests2.2a.out @@ -64,6 +64,7 @@ obviousloop.c: (in function f1b) obviousloop.c:59:3: Unreachable code: x = 12 obviousloop.c: (in function f2) obviousloop.c:75:3: Unreachable code: x = 12 +constraintGeneration.c:470 [obviousloop.c:76:2]: >> strange for statement:for (; ; ) { x++ }, ignoring it Finished LCLint checking --- 4 code errors found, as expected diff --git a/test/tests2.5/newlint.lcd b/test/tests2.5/newlint.lcd index e95015e..64e917b 100644 --- a/test/tests2.5/newlint.lcd +++ b/test/tests2.5/newlint.lcd @@ -60,7 +60,7 @@ 2 y17|17& 2 y18|18& -2 ?! -0 a1|& +0 s1|& 0 s2|& 0 s3|& 0 s4|& @@ -665,7 +665,6 @@ 3 f5 (!.,)! 3 f655 (!.,)! ;;tistable -1 0 0,16 16 @@ -678,7 +677,7 @@ ;;symTable *0 (Datatype) 0@+@=@0@7@0@0@67#mbstate_t -2@+@-@0@0@0@0@2#lltX_bool +2@-@-@0@0@0@0@2#lltX_bool 13@-@-@0@0@0@0@59#__SIZE_TYPE__ 13@-@-@0@0@0@0@60#__PTRDIFF_TYPE__ 13@-@-@0@0@0@0@61#__WCHAR_TYPE__ @@ -701,8 +700,8 @@ 372@-@-@0@0@0@0@374#ldiv_t *1 (Constant) 0@i0@0@6#NULL -2@i1@0@0#TRUE 2$#NDEBUG +2@i1@0@0#TRUE 2@i0@0@6#FALSE 3$#UCHAR_MAX#UCHAR_MIN 4$#CHAR_MAX#CHAR_MIN#SCHAR_MAX#SCHAR_MIN @@ -895,7 +894,5 @@ 630@442#@tm 118@119#@lconv ;; Modules access -lltX_bool#1@ -types#1@ -ansi#9@ +ansi#8@ ;;End -- 2.45.2