-10 September 2001
+25 September 2001
/* herald.h - created automatically by gmake updateversion */
/*@constant observer char *LCL_VERSION;@*/
-# define LCL_VERSION "LCLint 3.0.0.16 --- 10 September 2001"
+# define LCL_VERSION "LCLint 3.0.0.17 --- 25 September 2001"
/*@constant observer char *LCL_PARSE_VERSION;@*/
-# define LCL_PARSE_VERSION "LCLint 3.0.0.16"
+# define LCL_PARSE_VERSION "LCLint 3.0.0.17"
/*@constant observer char *LCL_COMPILE;@*/
-# define LCL_COMPILE "Compiled using gcc -DSTDC_HEADERS=1 on Linux matthews.cs.Virginia.EDU 2.4.3-12 #1 Fri Jun 8 13:35:30 EDT 2001 i686 unknown by drl7x"
+# 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"
/* herald.h - created automatically by gmake updateversion */
/*@constant observer char *LCL_VERSION;@*/
-# define LCL_VERSION "LCLint 3.0.0.16 --- 10 September 2001"
+# define LCL_VERSION "LCLint 3.0.0.17 --- 25 September 2001"
/*@constant observer char *LCL_PARSE_VERSION;@*/
-# define LCL_PARSE_VERSION "LCLint 3.0.0.16"
+# define LCL_PARSE_VERSION "LCLint 3.0.0.17"
/*@constant observer char *LCL_COMPILE;@*/
-# define LCL_COMPILE "Compiled using gcc -DSTDC_HEADERS=1 on Linux matthews.cs.Virginia.EDU 2.4.3-12 #1 Fri Jun 8 13:35:30 EDT 2001 i686 unknown by drl7x"
+# 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"
/*@constant observer char *SYSTEM_LIBDIR;@*/
# define SYSTEM_LIBDIR "/usr/include"
/*@constant observer char *DEFAULT_LARCHPATH;@*/
-# define DEFAULT_LARCHPATH ".:/af9/drl7x/reTmp/LCLintDev/lib"
+# define DEFAULT_LARCHPATH "/usr/local/lclint/lib"
/*@constant observer char *DEFAULT_LCLIMPORTDIR;@*/
-# define DEFAULT_LCLIMPORTDIR "/af9/drl7x/reTmp/LCLintDev/imports"
+# define DEFAULT_LCLIMPORTDIR "/usr/local/lclint/imports"
for (i = 0; i < ft->nopen; i++)
{
+ /*
+ lldiagmsg (message ("Unclosed file at exit: %s", ft->openelements[i]->fname));
+ */
+
+ (void) fclose (ft->openelements[i]->f); /* No check - cleaning up after errors */
lldiagmsg (message ("Unclosed file at exit: %s", cstring_toCharsSafe (ft->openelements[i]->fname)));
-
- /*@-retvalint@*/
- fclose (ft->openelements[i]->f); /* No check - cleaning up after errors */
- /*@=retvalint@*/
ft->openelements[i]->f = NULL;
foentry_free (ft->openelements[i]);
ft->openelements[i] = NULL;
(void) mtparse ();
context_exitMTfile ();
- inputStream_close (sourceFile);
+ check (inputStream_close (sourceFile));
inputStream_free (sourceFile);
}
# endif
}
+# if 0
+/*
+** This code provided by Herbert Martin Dietze, to canonicalize path names.
+*/
+
+char *osd_getcwd (/*@returned@*/ char *str, size_t size)
+{
+ return getcwd (str, size);
+}
+
+/*@null@*/ /*@observer@*/ char *
+osd_dirNext (char *str)
+{
+ char *p1 = strchr (str, '/');
+ char *p2 = strchr (str, '\\');
+
+ if (p1 == NULL)
+ {
+ if (p2 != NULL)
+ {
+ return p2 + 1;
+ }
+ else
+ {
+ return NULL;
+ }
+ }
+ else if (p2 == NULL)
+ {
+ return p1 + 1;
+ }
+ else /* both not null */
+ {
+ return (p1 < p2 ? p1 : p2) + 1;
+ }
+}
+
+static void
+osd_dirShift (char *str, size_t num) /*@modifies str@*/
+{
+ int i;
+
+ assert (num <= strlen (str));
+
+ for (i = 0; str[i] != '\0'; i++)
+ {
+ str[i] = str[i + num];
+ }
+}
+
+bool
+osd_dirDotdot (char *str)
+{
+ return str[0] == '.' && str[1] == '.' && osd_isConnectChar (str[2]);
+}
+
+void
+osd_dirNormalize (char *str)
+{
+ char *pos1, *pos2;
+
+ for (; osd_isConnectChar (str[0]); str++)
+ {
+ }
+
+ for (; str != NULL && osd_dirDotdot (str); str = osd_dirNext (str))
+ {
+ }
+
+ for (pos1 = pos2 = str;
+ pos1 != NULL;
+ pos2 = pos1, pos1 = osd_dirNext (pos1))
+ {
+ /* remove redundant `./' entry */
+ while (pos1[0] == '.' && osd_isConnectChar (pos1[1]))
+ {
+ osd_dirShift (pos1, 2);
+ }
+
+ /* remove redundant `foo/../' entry */
+ if (osd_dirDotdot (pos1) && pos2 < pos1)
+ {
+ osd_dirShift (pos2, pos1 - pos2 + 1);
+ osd_dirNormalize (str);
+ }
+ }
+}
+
+/*@null@*/ char *
+osd_dirAbsolute (char *str)
+{
+ char *ret = NULL;
+ size_t size = PATH_MAX * sizeof (*ret);
+
+ if (osd_isConnectChar (str[0]))
+ {
+ ret = dmalloc ((strlen (str) + 1) * sizeof (*ret));
+ strcpy (ret, str);
+ }
+ else
+ {
+ ret = dmalloc (size);
+
+ ret = osd_getcwd (ret, size);
+ ret = realloc (ret, (strlen (str) + strlen (ret) + 2) * sizeof (*ret));
+
+ if (ret == NULL)
+ {
+ return NULL;
+ }
+
+ strcat (ret, CONNECTSTR);
+ strcat (ret, str);
+ }
+
+ osd_dirNormalize (ret);
+ return ret;
+}
+
+# endif
if (strName != lsymbol_undefined && strMemList != NULL)
{
sort asort = sort_construct (strName, SRT_STRUCT, NOSORTHANDLE, tagName,
- TRUE, NOSORTHANDLE, strMemList);
+ TRUE, NOSORTHANDLE, strMemList);
if (tagName != lsymbol_undefined)
{
###
tests2.2:
- @echo " Note: expect difference in name of unclosed file."
setenv LCLINT '$(LCLINTRN)'; cd tests2.2 ; $(MAKE) -e
tests2.2a:
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-/* Output from LCLint 3.0.0.16 */
+/* Output from LCLint 3.0.0.17 */
# include "bool.h"
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-/* Output from LCLint 3.0.0.16 */
+/* Output from LCLint 3.0.0.17 */
# include "bool.h"
# include "mut.h"
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-/* Output from LCLint 3.0.0.16 */
+/* Output from LCLint 3.0.0.17 */
# include "bool.h"
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-/* Output from LCLint 3.0.0.16 */
+/* Output from LCLint 3.0.0.17 */
# include "bool.h"
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-/* Output from LCLint 3.0.0.16 */
+/* Output from LCLint 3.0.0.17 */
# include <stdio.h>
# include "bool.h"
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-/* Output from LCLint 3.0.0.16 */
+/* Output from LCLint 3.0.0.17 */
# include "bool.h"
# include "bool.h"
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-/* Output from LCLint 3.0.0.16 */
+/* Output from LCLint 3.0.0.17 */
# include "bool.h"
# include "employee.h"
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-/* Output from LCLint 3.0.0.16 */
+/* Output from LCLint 3.0.0.17 */
# include "bool.h"
# include "eref.h"
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-/* Output from LCLint 3.0.0.16 */
+/* Output from LCLint 3.0.0.17 */
# include "bool.h"
# include "employee.h"
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-/* Output from LCLint 3.0.0.16 */
+/* Output from LCLint 3.0.0.17 */
# include "bool.h"
# include "employee.h"
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-/* Output from LCLint 3.0.0.16 */
+/* Output from LCLint 3.0.0.17 */
# include <stdio.h>
# include "bool.h"
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-/* Output from LCLint 3.0.0.16 */
+/* Output from LCLint 3.0.0.17 */
# include <stdio.h>
# include "bool.h"
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-/* Output from LCLint 3.0.0.16 */
+/* Output from LCLint 3.0.0.17 */
# include "bool.h"
# include "employee.h"
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-/* Output from LCLint 3.0.0.16 */
+/* Output from LCLint 3.0.0.17 */
# include "bool.h"
# include "eref.h"
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-/* Output from LCLint 3.0.0.16 */
+/* Output from LCLint 3.0.0.17 */
# include "bool.h"
# include "employee.h"
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-/* Output from LCLint 3.0.0.16 */
+/* Output from LCLint 3.0.0.17 */
# include "bool.h"
# include "employee.h"
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-/* Output from LCLint 3.0.0.16 */
+/* Output from LCLint 3.0.0.17 */
# include "bool.h"
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-/* Output from LCLint 3.0.0.16 */
+/* Output from LCLint 3.0.0.17 */
# include "bool.h"
# include "bool.h"
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-/* Output from LCLint 3.0.0.16 */
+/* Output from LCLint 3.0.0.17 */
# include <stdio.h>
# include "bool.h"
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-/* Output from LCLint 3.0.0.16 */
+/* Output from LCLint 3.0.0.17 */
# include <stdio.h>
# include "bool.h"
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-/* Output from LCLint 3.0.0.16 */
+/* Output from LCLint 3.0.0.17 */
# include "bool.h"
# include "employee.h"
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-/* Output from LCLint 3.0.0.16 */
+/* Output from LCLint 3.0.0.17 */
# include "bool.h"
# include "eref.h"
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-/* Output from LCLint 3.0.0.16 */
+/* Output from LCLint 3.0.0.17 */
# include "bool.h"
# include "employee.h"
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-/* Output from LCLint 3.0.0.16 */
+/* Output from LCLint 3.0.0.17 */
# include "bool.h"
# include "employee.h"
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-%FAILED Output from LCLint 3.0.0.16
+%FAILED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-/* Output from LCLint 3.0.0.16 */
+/* Output from LCLint 3.0.0.17 */
# include "bool.h"
;;LCLint Dump: null6.lcd
-;;LCLint 3.0.0.16 --- 10 September 2001
+;;LCLint 3.0.0.17 --- 25 September 2001
;;lib:168
;;ctTable
0 u-2 19 38
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-/* Output from LCLint 3.0.0.16 */
+/* Output from LCLint 3.0.0.17 */
# include "bool.h"
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
extension.c:2:18: Parse Error: New function scope inside function. (For help on
parse errors, see lclint -help parseerrors.)
*** Cannot continue.
-Unclosed file at exit: /tmp/cl89AAA.c
Finished LCLint checking --- no code errors found
--- /dev/null
+
+boolops.c: (in function main)
+boolops.c:12:3: Assignment of int to Kzam: b = 12
+
+Finished LCLint checking --- 1 code error found, as expected
+
+mbool.h:1:17: Type implemented as macro: bool
+
+Finished LCLint checking --- 1 code error found, as expected
+
+boolenum.c: (in function main)
+boolenum.c:11:8: Use of == with BOOLEAN variables (risks inconsistency because
+ of multiple true values): a == TRUE
+
+Finished LCLint checking --- 1 code error found, as expected
+
+break.c: (in function f)
+break.c:9:4: Dereference of possibly null pointer x: *x
+ break.c:1:24: Storage x may become null
+
+Finished LCLint checking --- 1 code error found, as expected
+
+bstring.c:4:14: Initial value of s4[0] is type char *, expects char: "hullo"
+bstring.c:4:23: Initial value of s4[1] is type char *, expects char: "g'bye"
+
+Finished LCLint checking --- 2 code errors found, as expected
+
+decl.c:3:21: Structure struct tm declared with fields { int x; }, specified
+ with fields { int tm_sec; int tm_min; int tm_hour;, ... }
+ load file ansi.lcd:961:1: Specification of struct tm
+ decl.c:3:17: Field tm_sec in specified corresponds to x in declaration
+ load file ansi.lcd:637:1: Specification of tm_sec
+
+Finished LCLint checking --- 1 code error found, as expected
+
+enumbool.c:1:34: Member of boolean enumerated type definition does not match
+ name set to represent TRUE or FALSE: false
+enumbool.c:1:34: Member of boolean enumerated type definition does not match
+ name set to represent TRUE or FALSE: true
+
+Finished LCLint checking --- 2 code errors found, as expected
+
+Finished LCLint checking --- no code errors found
+
+Finished LCLint checking --- no code errors found
+
+extension.c:2:18: Parse Error: New function scope inside function. (For help on
+ parse errors, see lclint -help parseerrors.)
+*** Cannot continue.
+
+Finished LCLint checking --- no code errors found
+
+nestext.c: (in function f)
+nestext.c:3:26: Declaration using extern inside function scope: int test(void)
+
+Finished LCLint checking --- 1 code error found, as expected
+
+sizeofarray.c:1:12: Function parameter x declared as manifest array (size
+ constant is meaningless)
+sizeofarray.c: (in function f)
+sizeofarray.c:5:13: Parameter to sizeof is an array-type function parameter:
+ sizeof((x))
+sizeofarray.c:10:16: Return value type size_t does not match declared type int:
+ sizeof((a))
+
+Finished LCLint checking --- 3 code errors found, as expected
+
+rex.c: (in function main)
+rex.c:19:12: Only storage re.parent (type struct rx_hash *) derived from
+ variable declared in this scope is not released (memory leak)
+rex.c:19:12: Only storage *(re.children)->parent (type struct rx_hash *)
+ derived from variable declared in this scope is not released (memory leak)
+rex.c:19:12: Only storage *(*(re.children)->children)->parent (type struct
+ rx_hash *) derived from variable declared in this scope is not released
+ (memory leak)
+rex.c:19:12: Only storage *(*(*(re.children)->children)->children)->parent
+ (type struct rx_hash *) derived from variable declared in this scope is not
+ released (memory leak)
+
+Finished LCLint checking --- 4 code errors found, as expected
+
+struct.c:13:6: Function main declared to return void, should return int
+
+Finished LCLint checking --- 1 code error found, as expected
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
;;LCLint Dump: newlint.lcd
-;;LCLint 3.0.0.16 --- 10 September 2001
+;;LCLint 3.0.0.17 --- 25 September 2001
;;lib:168
;;ctTable
0 u-2 19 38
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil
-%PASSED Output from LCLint 3.0.0.16
+%PASSED Output from LCLint 3.0.0.17
%LCLimports
%LCLSortTable
%LCLsort bool immutable nil nil