]> andersk Git - splint.git/blobdiff - test/db1.expect
noexpand always false.
[splint.git] / test / db1.expect
index c0f7a5d09a7b35f8588368ec54d64d73320ec167..0132b0a020e0c2fbc9e73e169f4acddb54d2bae9 100644 (file)
@@ -1,9 +1,10 @@
-make -e clean
-make -e check
 
 employee.c: (in function employee_equal)
 employee.c:25: Function strncmp expects arg 3 to be size_t gets int:
                   maxEmployeeName
+employee.c: (in function employee_sprint)
+employee.c:33: Buffer overflow possible with sprintf.  Recommend using snprintf
+                  instead: sprintf
 empset.c: (in function empset_insert)
 empset.c:28: Variable er declared but not used
 empset.c: (in function empset_disjointUnion)
@@ -23,10 +24,6 @@ empset.c:135: Variable e declared but not used
 ereftab.c: (in function ereftab_lookup)
 ereftab.c:34: Undocumented modification of t possible from call to
                  erc_iterStart: erc_iterStart(t)
-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
@@ -36,25 +33,33 @@ dbase.c: (in function query)
 dbase.c:210: Variable er declared but not used
 dbase.c:211: Variable e declared but not used
 drive.c: (in function main)
+drive.c:47: Buffer overflow possible with sprintf.  Recommend using snprintf
+               instead: sprintf
+drive.c:63: Buffer overflow possible with sprintf.  Recommend using snprintf
+               instead: sprintf
+drive.c:81: Buffer overflow possible with sprintf.  Recommend using snprintf
+               instead: sprintf
+drive.c:118: Buffer overflow possible with sprintf.  Recommend using snprintf
+                instead: sprintf
 drive.c:123: Return value (type db_status) ignored: hire(e)
 
-Finished LCLint checking --- 16 code errors found, as expected
+Finished checking --- 19 code warnings, as expected
 
-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
-    <errno.h>. (See ANSI, Section 4.13.1)
-eref.h:2: Name EREF_H is reserved for future ANSI library extensions. Macros
+employee.h:2: Name EMPLOYEE_H is reserved for future library extensions. Macros
+    beginning with E and a digit or uppercase letter may be added to <errno.h>.
+    (ISO99:7.26.3)
+eref.h:2: Name EREF_H is reserved for future library extensions. Macros
     beginning with E and a digit or uppercase letter may be added to <errno.h>.
-    (See ANSI, Section 4.13.1)
-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
-    <errno.h>. (See ANSI, Section 4.13.1)
-erc.h:2: Name ERC_H is reserved for future ANSI library extensions. Macros
+    (ISO99:7.26.3)
+empset.h:2: Name EMPSET_H is reserved for future library extensions. Macros
     beginning with E and a digit or uppercase letter may be added to <errno.h>.
-    (See ANSI, Section 4.13.1)
-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
-    <errno.h>. (See ANSI, Section 4.13.1)
+    (ISO99:7.26.3)
+erc.h:2: Name ERC_H is reserved for future library extensions. Macros beginning
+    with E and a digit or uppercase letter may be added to <errno.h>.
+    (ISO99:7.26.3)
+ereftab.h:4: Name EREFTAB_H is reserved for future library extensions. Macros
+    beginning with E and a digit or uppercase letter may be added to <errno.h>.
+    (ISO99:7.26.3)
 bool.h:20: Modifies list for bool_initMod uses global internal state, not
               included in globals list.
    bool.h:20: Declaration of bool_initMod
@@ -63,8 +68,9 @@ employee.c:5: Definition parameter name e does not match name of corresponding
                  parameter in declaration: p_e
    employee.h:12: Previous declaration of p_e
 employee.c: (in function employee_setName)
-employee.c:12: Undefined storage e->name corresponds to storage listed in
-                  defines clause
+employee.c:12: Undefined storage e->name corresponds to storage listed in sets
+                  clause
+   This sub-reference is undefined: *(e->name)
 employee.c:12: Body of if statement is not a block: return FALSE
 employee.c:15: Parameter 1 (e->name) to function strcpy is declared unique but
                   may be aliased externally by parameter 2 (na)
@@ -84,12 +90,14 @@ employee.c:31: Read-only string literal storage used as initial value for
                   unqualified storage: jobs[1] = "non-manager"
 employee.c:31: Read-only string literal storage used as initial value for
                   unqualified storage: jobs[2] = "?"
+employee.c:33: Buffer overflow possible with sprintf.  Recommend using snprintf
+                  instead: sprintf
 employee.c:34: Array fetch using non-integer, gender: gender[e.gen]
 employee.c:34: Array fetch using non-integer, job: jobs[e.j]
 employee.h: (in macro employee_initMod)
-employee.h:14: Called procedure bool_initMod may access internal state, but
+employee.h:15: Called procedure bool_initMod may access internal state, but
                   globals list does not include globals internalState
-employee.h:14: Undocumented modification of internal state possible from call
+employee.h:15: Undocumented modification of internal state possible from call
                   to bool_initMod: bool_initMod()
 eref.h:9: Constant exported, but not specified: used
 eref.h:9: Constant exported, but not specified: avail
@@ -133,7 +141,7 @@ 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: 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[]:
@@ -195,8 +203,8 @@ empset.c:5: Name _empset_get is in the implementation name space (any
 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:15: Body of if statement is not a block: do { { erc_iterFinal(it);
+                return er } } while (FALSE);
 empset.c: (in function empset_insert)
 empset.c:30: Undetected modification possible from call to unconstrained
                 function _empset_get: _empset_get
@@ -215,29 +223,29 @@ empset.c:85: Undocumented modification of s1 possible from call to
 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_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: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)
+                 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: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)
+    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: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:141: Body of if statement is not a block: do { { erc_iterFinal(it);
+                 return FALSE } } 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)
+    if (!empset_member(eref_get(er), s2)) do { { erc_iterFinal(it);
+    return FALSE } } 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
@@ -266,14 +274,15 @@ 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:8: Fresh storage c created
 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: Object equality comparison (==) on objects of 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
@@ -281,29 +290,31 @@ 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:78: Object equality comparison (==) on objects of abstract type (eref):
+             elem->val == er
 erc.c:83: Implicitly only storage prev->next (type struct _elem *) not released
              before assignment: prev->next = elem->next
 erc.c:84: 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:81: Storage elem becomes implicitly only (through alias c->vals)
 erc.c:87: Released storage c->vals reachable from parameter at return point
-   erc.c:85: Storage c->vals is released
+   erc.c:85: Storage c->vals 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:98: Fresh storage result created
 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:118: in true branch:
+   erc.c:117: Storage it 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: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
@@ -311,7 +322,7 @@ 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.c:140: Fresh storage result created
 erc.h: (in macro erc_choose)
 erc.h:15: Macro parameter used without parentheses: c
 erc.h: (in macro erc_initMod)
@@ -381,9 +392,9 @@ dbase.c:123: Array fetch using non-integer, enum { mMGRS, fMGRS, mNON, fNON }:
 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)
+                erc_insert(db[mMGRS], er);
 dbase.c:123: Body of else clause of if statement is not a block:
-                erc_insert(db[mNON], er)
+                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]
@@ -395,11 +406,11 @@ dbase.c:128: Array fetch using non-integer, enum { mMGRS, fMGRS, mNON, 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)
+                erc_insert(db[fMGRS], er);
 dbase.c:128: Body of else clause of if statement is not a block:
-                erc_insert(db[fNON], er)
+                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)
+    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,
@@ -412,10 +423,12 @@ 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) }
+                if (eref_get(er).ssNum == ssNum) { erc_iterFinal(it);
+                erc_delete(db[i], er);; return TRUE }
 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) }
+    er = erc_yield(it)) if (eref_get(er).ssNum == ssNum) { erc_iterFinal(it);
+    erc_delete(db[i], er);; return TRUE }
 dbase.c:137: Incompatible types for <= (int, enum { mMGRS, fMGRS, mNON, fNON })
                 (in post loop test): i <= fNON
 dbase.c: (in function promote)
@@ -463,7 +476,7 @@ 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)
+                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
@@ -540,17 +553,26 @@ dbase.c:272: Incompatible types for <= (int, enum { mMGRS, fMGRS, mNON, fNON })
 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:47: Buffer overflow possible with sprintf.  Recommend using snprintf
+               instead: sprintf
 drive.c:48: Return value (type bool) ignored: employee_setName...
 drive.c:49: Return value (type bool) ignored: empset_insert(em...
+drive.c:63: Buffer overflow possible with sprintf.  Recommend using snprintf
+               instead: sprintf
 drive.c:64: Return value (type bool) ignored: employee_setName...
 drive.c:65: Return value (type bool) ignored: empset_delete(em...
+drive.c:81: Buffer overflow possible with sprintf.  Recommend using snprintf
+               instead: sprintf
 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: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:118: Buffer overflow possible with sprintf.  Recommend using snprintf
+                instead: sprintf
 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)
@@ -559,25 +581,25 @@ 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
 dbase.c:11: Type employeeKinds declared but not used
-eref.lh:8: Function exported but not used outside eref: eref_free
+eref.lh:7: 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.lh:7: 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.lh:8: 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.lh:10: 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.lh:16: 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.lh:17: 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.lh:9: 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.lh:26: 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.lh:27: 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
@@ -600,58 +622,59 @@ dbase.c:73: Function _db_addEmpls exported but not declared in header file
 
 Error Type                Reported  Suppressed
 ===================       ========  =========
-abstract                     2           0
-mayaliasunique               1           0
-exitarg                      8           0
-unreachable                  1           0
-forempty                     1           0
-forblock                    11           0
-ifblock                     22           0
-redecl                       0           7
-incondefs                    0           1
+nullret                      1           0
+nullstate                    1           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                      3           0
+incondefs                    0           1
+sizeoftype                   7           0
+formalarray                  0          24
+abstractcompare              2           0
+mustfreeonly                 3           0
+usereleased                  1           0
 compdestroy                  1           0
-mustfree                     3           0
 branchstate                  2           1
 onlytrans                    1           0
 freshtrans                   3           0
 temptrans                    3           2
 readonlytrans                6           0
+mayaliasunique               1           0
 mods                        38           0
 mustmod                      2           0
 modfilesys                   0          25
 modnomods                    4           0
 moduncon                    20           0
 modunconnomods               1           0
+globs                       64           1
+internalglobs                2           0
+warnmissingglobs             1           6
+forempty                     1           0
+forblock                    11           0
+ifblock                     22           0
+unreachable                  1           0
+noeffect                    11           0
+retvalother                  1           0
+retvalbool                  16           0
+macroparens                  4           0
 namechecks                  11           6
 protoparammatch              1           0
-nullret                      1           0
-nullstate                    1           0
-sizeoftype                   7           0
-formalarray                  0          24
-type                         1           0
-enumindex                   24           0
-enumint                     15           0
-matchanyintegral             2           0
 exportlocal                 15           0
 exportheader                 4           0
 exportheadervar              2           0
 paramuse                     1           0
 typeuse                      1           0
 varuse                       4           0
+exitarg                      8           0
+redecl                       0           7
+exporttype                   5           0
+exportvar                    2           0
+exportconst                  2           0
+type                         1           0
+enumindex                   24           0
+enumint                     15           0
+matchanyintegral             2           0
+bufferoverflowhigh           5           0
                           ========  =========
-Total                      333          73
+Total                      338          73
 
-Finished LCLint checking --- 333 code errors found, as expected
+Finished checking --- 338 code warnings, as expected
This page took 0.535377 seconds and 4 git commands to generate.