]> andersk Git - splint.git/commitdiff
*** empty log message ***
authorevans1629 <evans1629>
Wed, 12 Sep 2001 23:24:07 +0000 (23:24 +0000)
committerevans1629 <evans1629>
Wed, 12 Sep 2001 23:24:07 +0000 (23:24 +0000)
124 files changed:
README
src/DATE
src/Headers/cstring.h
src/Headers/fileLib.h
src/Headers/globals.h
src/Headers/herald.h
src/Headers/herald.last
src/Headers/local_constants.h
src/Headers/local_constants.last
src/Headers/misc.h
src/Headers/osd.h
src/Headers/portab.h
src/Headers/sRef.h
src/Makefile
src/context.c
src/cpplib.c
src/cscanner.l
src/cstring.c
src/exprNode.c
src/fileLib.c
src/fileTable.c
src/fileloc.c
src/general.c
src/lastversion
src/lclint.lclintrc
src/llmain.c
src/mtgrammar.c
src/mtgrammar.y
src/nameChecks.c
src/osd.c
src/sRef.c
src/uentry.c
src/uentryList.c
test/abst_t.lcs
test/abstptr.lcs
test/alias.lcs
test/alias2.lcs
test/alias3.lcs
test/alias3.lh
test/alias4.lcs
test/alias4.lh
test/alias5.lcs
test/alias5.lh
test/argorder2.lcs
test/argorder4.lcs
test/args.lcs
test/cast.lcs
test/db1/bool.lcs
test/db1/bool.lh
test/db1/dbase.lcs
test/db1/dbase.lh
test/db1/employee.lcs
test/db1/employee.lh
test/db1/empset.lcs
test/db1/empset.lh
test/db1/erc.lcs
test/db1/erc.lh
test/db1/eref.lcs
test/db1/eref.lh
test/db1/ereftab.lcs
test/db1/ereftab.lh
test/db2/dbase.lcs
test/db2/dbase.lh
test/db2/employee.lcs
test/db2/employee.lh
test/db2/empset.lcs
test/db2/empset.lh
test/db2/erc.lcs
test/db2/erc.lh
test/db2/eref.lcs
test/db2/eref.lh
test/db2/ereftab.lcs
test/db2/ereftab.lh
test/db3/bool.lcs
test/db3/bool.lh
test/db3/check.lcs
test/db3/check.lh
test/db3/dbase.lcs
test/db3/dbase.lh
test/db3/employee.lcs
test/db3/employee.lh
test/db3/empset.lcs
test/db3/empset.lh
test/db3/erc.lcs
test/db3/erc.lh
test/db3/eref.lcs
test/db3/eref.lh
test/db3/ereftab.lcs
test/db3/ereftab.lh
test/decl2.lcs
test/enum.lcs
test/fileio/file.c [new file with mode: 0644]
test/fileio/filebranch.c [new file with mode: 0644]
test/glob.lcs
test/impabstract.lcs
test/iter.lcs
test/macros.lcs
test/macrosef.lcs
test/mergestate/tainted.mts [new file with mode: 0644]
test/mergestate/tainted.xh [new file with mode: 0644]
test/mergestate/taintednm.c [new file with mode: 0644]
test/mergestate/taintednm.mts [new file with mode: 0644]
test/mergestate/taintednm.xh [new file with mode: 0644]
test/modtest.lcs
test/mut.lcs
test/mut.lh
test/null6.lcd
test/null6.lcs
test/observer.lcs
test/oldstyle.lcs
test/outglob.lcs
test/outparam.lcs
test/postnotnull.c [new file with mode: 0644]
test/postnotnull.expect [new file with mode: 0644]
test/repexpose.lcs
test/repexpose.lh
test/special.lcs
test/tests2.2/bool.lcs
test/tests2.4/subdir/main.lcs
test/tests2.5/newlint.lcd
test/tq.lcs
test/ud2.lcs
test/unsignedcompare.c [new file with mode: 0644]
test/unsignedcompare.expect [new file with mode: 0644]

diff --git a/README b/README
index bf5a4c4c3aef4a055d633cf6344469a6a386f898..f365a5c024d5eb88b6a7afbf10d3960abe745c02 100644 (file)
--- a/README
+++ b/README
@@ -23,24 +23,30 @@ To build LCLint you need:
      system, download it from prep.ai.mit.edu.
    o standard Unix tools: gzip, tar
 
-1. Download the LCLint source package (lclint.src.tar.gz).
+You should also have:
 
-   Copy this package to the directory where you want to build LCLint.  When
-   the tar file is extracted, it will create an lclint-3.0.0.9 subdirectory.
+   o flex
+   o bison version 1.28 or later - bison 1.27 and 1.25 are believed to
+     have bugs that cause problems with lclint's parsers.  
+
+If these are unavailable, you may be able to build lclint anyway using
+the derived grammar files.  This is not recommended however.
 
-2. Uncompress the package:
-      gzip -d lclint.src.tar.gz 
+1. Download the LCLint source package (lclint-<version>.src.tgz).
+
+   Copy this package to the directory where you want to build LCLint.  When
+   the tar file is extracted, it will create an lclint-<version> subdirectory.
 
-3. Extract files from the tar archive:
-      tar xf lclint.src.tar
+2. Extract files from the tar archive:
+      tar xzf lclint-<version>.src.tgz
 
-4. Run: configure
+3. Run: ./configure
   
    This will create a Makefile with settings for your system. If you 
    want to install LCLint or associated libraries different
    directories, edit the Makefile.
 
-5. Run: gmake
+4. Run: gmake
 
    It is best to do this in an emacs shell or a buffered terminal,
    so you can scroll through the output.
@@ -59,7 +65,7 @@ To build LCLint you need:
    (usually ~/.environment). 
 
    Set up your PATH to include the directory containing
-   lclint-3.0.0.9/bin/lclint, or move the binary to a directory on
+   lclint-<version>/bin/lclint, or move the binary to a directory on
    your command path.
 
 7. Run: gmake test
index 87ec3a5aaf00ce6a6cc2f75dca7ebd0bc0d3c44b..cdf52e87262f3b1de2256a7b1ede72eed39555e0 100644 (file)
--- a/src/DATE
+++ b/src/DATE
@@ -1 +1 @@
-27 August 2001
+10 September 2001
index f82502edb286ffd892b567bebb4b89bad04ae53e..8a4ce5aa06120e241bee67f42d561b120efa08f5 100644 (file)
@@ -46,9 +46,8 @@ extern cmpcode cstring_genericEqual (cstring p_s, cstring p_t,
                                     bool p_caseinsensitive,
                                     bool p_lookalike) /*@*/ ;
 
-# ifdef WIN32
+/* evans 2001-09-09 - removed conditional compilation on this (for WIN32, OS2) */
 extern void cstring_replaceAll (cstring p_s, char p_old, char p_snew) /*@modifies p_s@*/ ;
-# endif
 
 extern void cstring_replaceLit (/*@unique@*/ cstring p_s, char *p_old, char *p_snew);
 extern char cstring_firstChar (cstring p_s) /*@*/ ;
@@ -70,8 +69,8 @@ extern bool cstring_equal (cstring p_c1, cstring p_c2) /*@*/ ;
 extern bool cstring_equalCaseInsensitive (cstring p_c1, cstring p_c2) /*@*/ ;
 extern bool cstring_equalLen (cstring p_c1, cstring p_c2, int p_len) /*@*/ ;
 extern bool cstring_equalLenCaseInsensitive (cstring p_c1, cstring p_c2, int p_len) /*@*/ ;
-extern bool cstring_equalPrefix (cstring p_c1, char *p_c2) /*@*/ ;
-extern bool cstring_equalCanonicalPrefix (cstring p_c1, char *p_c2) /*@*/ ;
+extern bool cstring_equalPrefix (cstring p_c1, cstring p_c2) /*@*/ ;
+extern bool cstring_equalPrefixLit (cstring p_c1, /*@observer@*/ const char *p_c2) /*@*/ ;
 extern bool cstring_equalLit (cstring p_c1, char *p_c2) /*@*/ ;
 extern int cstring_compare (cstring p_c1, cstring p_c2) /*@*/ ;
 extern int cstring_xcompare (cstring *p_c1, cstring *p_c2) /*@*/ ;
@@ -175,6 +174,7 @@ extern lsymbol cstring_toSymbol (/*@only@*/ cstring p_s) /*@*/ ;
 extern void cstring_markOwned (/*@owned@*/ cstring p_s) /*@modifies p_s@*/ ;
 
 extern cstring cstring_beforeChar (cstring p_s, char p_c) /*@*/ ;
+extern /*@exposed@*/ cstring cstring_afterChar (cstring p_s, char p_c) /*@*/ ;
 
 /*@iter cstring_chars (sef cstring s, yield char c);@*/
 # define cstring_chars(s, m_c) \
index 7d295647200c891ed3c8af9a34a405ad41966a54..e08dd54bdccde61443218a295dd56c9048e69672 100644 (file)
@@ -46,4 +46,8 @@ extern /*@observer@*/ cstring
 /*@constant observer cstring XH_EXTENSION;@*/
 # define XH_EXTENSION cstring_makeLiteralTemp (".xh")
 
+/* C files that have already been preprocessed */
+/*@constant observer cstring PP_EXTENSION;@*/
+# define PP_EXTENSION cstring_makeLiteralTemp (".pp")
+
 # endif
index 0ae63ac95887174be204cb3c75a0daa756506dec..3d224742bd92cfd02443a5999f457b3595ee87bb 100644 (file)
@@ -24,10 +24,6 @@ extern /*@dependent@*/ /*:open:*/ FILE *yyout;
 extern int yyleng;
 /*@=incondefs@*/ 
 
-# ifdef WIN32
-extern int yywrap (void) /*@*/ ;
-# endif
-
 extern int yydebug;
 /*@=redecl@*/
 /*@=namechecks@*/
index 932ddca37dca80092b6c0ae2dabacce3f96093f9..41109ac7d22c8a3e0b5bad4323603427bc765ac9 100644 (file)
@@ -1,7 +1,7 @@
 /* herald.h - created automatically by gmake updateversion */
 /*@constant observer char *LCL_VERSION;@*/
-# define LCL_VERSION "LCLint 3.0.0.13 --- 27 August 2001"
+# define LCL_VERSION "LCLint 3.0.0.16 --- 10 September 2001"
 /*@constant observer char *LCL_PARSE_VERSION;@*/
-# define LCL_PARSE_VERSION "LCLint 3.0.0.13"
+# define LCL_PARSE_VERSION "LCLint 3.0.0.16"
 /*@constant observer char *LCL_COMPILE;@*/
-# define LCL_COMPILE "Compiled using gcc -DSTDC_HEADERS=1 -g -Wall on Linux paisley 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"
index 55106ed3500efb208a5038df48bea22db81cbcc7..41109ac7d22c8a3e0b5bad4323603427bc765ac9 100644 (file)
@@ -1,7 +1,7 @@
 /* herald.h - created automatically by gmake updateversion */
 /*@constant observer char *LCL_VERSION;@*/
-# define LCL_VERSION "LCLint 3.0.0.13 --- 27 August 2001"
+# define LCL_VERSION "LCLint 3.0.0.16 --- 10 September 2001"
 /*@constant observer char *LCL_PARSE_VERSION;@*/
-# define LCL_PARSE_VERSION "LCLint 3.0.0.13"
+# define LCL_PARSE_VERSION "LCLint 3.0.0.16"
 /*@constant observer char *LCL_COMPILE;@*/
-# define LCL_COMPILE "Compiled using gcc -DSTDC_HEADERS=1 -g -Wall on Linux fowler 2.4.3-12 #1 Fri Jun 8 13:35:30 EDT 2001 i686 unknown by drl7x"
+# 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"
index 73e13fc02ff2ff0ec28919e4f5adc9cc5c4dac80..59668c381b0bfeadad196ce9509be87760bdd51f 100644 (file)
@@ -2,6 +2,6 @@
 /*@constant observer char *SYSTEM_LIBDIR;@*/
 # define SYSTEM_LIBDIR "/usr/include"
 /*@constant observer char *DEFAULT_LARCHPATH;@*/
-# define DEFAULT_LARCHPATH ".:/af9/drl7x/re3/LCLintDev/lib"
+# define DEFAULT_LARCHPATH "/usr/local/lclint/lib"
 /*@constant observer char *DEFAULT_LCLIMPORTDIR;@*/
-# define DEFAULT_LCLIMPORTDIR "/af9/drl7x/re3/LCLintDev/imports"
+# define DEFAULT_LCLIMPORTDIR "/usr/local/lclint/imports"
index 73e13fc02ff2ff0ec28919e4f5adc9cc5c4dac80..59668c381b0bfeadad196ce9509be87760bdd51f 100644 (file)
@@ -2,6 +2,6 @@
 /*@constant observer char *SYSTEM_LIBDIR;@*/
 # define SYSTEM_LIBDIR "/usr/include"
 /*@constant observer char *DEFAULT_LARCHPATH;@*/
-# define DEFAULT_LARCHPATH ".:/af9/drl7x/re3/LCLintDev/lib"
+# define DEFAULT_LARCHPATH "/usr/local/lclint/lib"
 /*@constant observer char *DEFAULT_LCLIMPORTDIR;@*/
-# define DEFAULT_LCLIMPORTDIR "/af9/drl7x/re3/LCLintDev/imports"
+# define DEFAULT_LCLIMPORTDIR "/usr/local/lclint/imports"
index f6302557660c1de74d1091fb6f179dc240c6c2f0..cd0217acfa938fbc14d4e4ea77f2e9387ea03853 100644 (file)
@@ -49,7 +49,8 @@ extern char *mstring_append (/*@only@*/ char *p_s1, char p_c);
 extern char *mstring_copy (/*@null@*/ char *p_s1) /*@*/ ;
 extern bool mstring_equalPrefix (const char *p_c1, const char *p_c2) /*@*/ ;
 extern bool mstring_equal (/*@null@*/ const char *p_s1, /*@null@*/ const char *p_s2) /*@*/ ;
-extern bool mstring_containsChar (const char *p_s, char p_c) /*@*/ ;
+extern bool mstring_containsChar (/*@unique@*/ const char *p_s, char p_c) /*@*/ ;
+extern bool mstring_containsString (/*@unique@*/ const char *p_s, /*@unique@*/ const char *p_c) /*@*/ ;
 
 extern int mstring_length (/*@sef@*/ /*@null@*/ char *p_s) /*@*/ ;
 # define mstring_length(s) \
index 87221000fcdf2fd5d32309b68ae9c7b3dc151242..4a6db393d22299155498863c8e364234a6da2c98 100644 (file)
@@ -77,6 +77,8 @@ extern /*@observer@*/ cstring osd_getEnvironmentVariable (cstring) ;
 extern int osd_system (cstring p_cmd) /*@modifies fileSystem@*/ ;
 # endif
 
+extern bool osd_equalCanonicalPrefix (cstring p_dirpath, cstring p_prefixpath) /*@*/ ;
+
 extern int osd_unlink (cstring) /*@modifies fileSystem@*/ ;
 extern cstring osd_fixDefine (cstring);
 extern bool osd_fileIsReadable (cstring);
index 0422145c080a7cc391acf4beca6ba36b37fddc01..2b1a936d775a328b54c5860f2034a5f18e6e7537 100644 (file)
 # define S_IFMT (unsigned short)0xFFFF
 # endif
 
+# if defined (OS2) || defined (MSDOS) || defined (WIN32)
+/*@constant observer cstring INCLUDEPATH_VAR@*/
+# define INCLUDEPATH_VAR    cstring_makeLiteralTemp ("INCLUDE")
+# else
 /*@constant observer cstring INCLUDEPATH_VAR@*/
 # define INCLUDEPATH_VAR    cstring_makeLiteralTemp ("CPATH")
+# endif
 
 #if defined (VMS)
-/* Connection string inserted between directory and filename to make a  */
-/* full path name.                                                     */
+
+/*
+** VMS is here, but hasn't been tested for many releases.  Not sure if this works.
+*/
+
+/*
+** Connection string inserted between directory and filename to make a  
+** full path name.                                                     
+*/
 
 # define    CONNECTSTR ":"
 # define    CONNECTCHAR        ':'
 
-
 /* Directory separator character for search list. */
 /*@constant static char PATH_SEPARATOR; @*/
 # define PATH_SEPARATOR ':'
 # else
 # error "Multiple include"
 # endif
+
index da8bbf96ddf852ebfb41bb06a3aa11393cf6a089..a5a2684fde5999c7a7056e80d752d0261b0ca22d 100644 (file)
@@ -688,6 +688,12 @@ sRef_aliasSetCompleteParam (void (p_predf) (sRef, int, fileloc), sRef p_s,
                            int p_kind, fileloc p_loc)
    /*@modifies p_s@*/ ;
 
+extern void
+sRef_aliasSetCompleteAlkParam (void (p_predf) (sRef, alkind, fileloc), sRef p_s, 
+                              alkind p_kind, fileloc p_loc)
+     /*@modifies p_s@*/ ;
+
+
 
 
 
index 554545216a5ef9a2cb0f7e9965c73bf4980a158b..f6680562a3c674b7f13ec388ee2ca42ec6181c76 100644 (file)
@@ -222,7 +222,7 @@ betarelease:
        mkdir ~/temp/lclint-`cat ${VERSION_NUMBER}`/src
        cp Makefile* ${ALLSRC} ${GRAMS} *.i flags.def ~/temp/lclint-`cat ${VERSION_NUMBER}`/src/
        cp cscanner.c ~/temp/lclint-`cat ${VERSION_NUMBER}`/src/cscanner.c.der
-       cp lastversion maketags ~/temp/lclint-`cat ${VERSION_NUMBER}`/src/
+       cp DATE lastversion maketags ~/temp/lclint-`cat ${VERSION_NUMBER}`/src/
        cp *.head *.reset ~/temp/lclint-`cat ${VERSION_NUMBER}`/src/
        cp cgrammar.c ~/temp/lclint-`cat ${VERSION_NUMBER}`/src/cgrammar.c.der
        cp llgrammar.c ~/temp/lclint-`cat ${VERSION_NUMBER}`/src/llgrammar.c.der
@@ -231,6 +231,7 @@ betarelease:
        cp -r Headers ~/temp/lclint-`cat ${VERSION_NUMBER}`/src/
        cp -r ../lib ~/temp/lclint-`cat ${VERSION_NUMBER}`/lib
        cp -r ../imports ~/temp/lclint-`cat ${VERSION_NUMBER}`/imports
+       cp -r ../os2 ~/temp/lclint-`cat ${VERSION_NUMBER}`/os2
        cp -r ../test ~/temp/lclint-`cat ${VERSION_NUMBER}`/test
        cp ../configure ../Makefile* ../LICENSE ../README ../BUFFERCHECKING ~/temp/lclint-`cat ${VERSION_NUMBER}`/
        cd ~/temp/lclint-`cat ${VERSION_NUMBER}`; mkdir bin
index 021aeb89d60f0215f1a41c0a8558bd5d0ceabb3b..4344a3f006286512456044fe2dc9aaa36d806c31 100644 (file)
@@ -1308,44 +1308,44 @@ context_isSpecialFile (cstring fname)
 bool
 context_isSystemDir (cstring dir)
 {
-  cstring sysDirs = context_exposeString (FLG_SYSTEMDIRS);
-  char *thisdir = cstring_toCharsSafe (sysDirs);
-  char *nextdir = strchr (thisdir, PATH_SEPARATOR);
-
-  if (nextdir != NULL)
+  cstring thisdir = cstring_copy (context_getString (FLG_SYSTEMDIRS));
+  cstring savedir = thisdir;
+  cstring nextdir = cstring_afterChar (thisdir, PATH_SEPARATOR);
+  
+  if (cstring_isDefined (nextdir))
     {
-      *nextdir = '\0';
+      /*@access cstring@*/
+      *nextdir = '\0'; /* closes thisdir */
       nextdir += 1;
+      /*@noaccess cstring@*/
     }
 
-  while (thisdir != NULL)
+  /* 2001-09-09: added thisdir[0] != '\0' 
+  **   herbert: don't compare with an empty name! 
+  **   should return false for empty directory path
+  */
+
+  while (!cstring_isEmpty (thisdir))
     {
       DPRINTF (("Test: %s / %s", dir, thisdir));
 
-      if (cstring_equalCanonicalPrefix (dir, thisdir))
+      if (osd_equalCanonicalPrefix (dir, thisdir))
        {
-         if (nextdir != NULL)
-           {
-             *(nextdir - 1) = PATH_SEPARATOR;
-           }
-         
+         cstring_free (savedir);
          return TRUE;
        }
 
-      if (nextdir != NULL)
-       {
-         *(nextdir - 1) = PATH_SEPARATOR;
-       }
-
-      if (nextdir != NULL)
+      if (cstring_isDefined (nextdir))
        {
          thisdir = nextdir;
-         nextdir = strchr (thisdir, PATH_SEPARATOR);
+         nextdir = cstring_afterChar (thisdir, PATH_SEPARATOR);
          
-         if (nextdir != NULL)
+         if (cstring_isDefined (nextdir))
            {
+             /*@access cstring@*/
              *nextdir = '\0';
              nextdir += 1;
+             /*@noaccess cstring@*/
            } 
        }
       else
@@ -1355,6 +1355,7 @@ context_isSystemDir (cstring dir)
     } 
 
   DPRINTF (("Returns FALSE"));
+  cstring_free (savedir);
   return FALSE;
 }
 
index 7d202040551b6ce8ee534826dac2904ae1f56d6c..3760939a6f466a652486db882a83cc94d38e4780 100644 (file)
@@ -1263,7 +1263,8 @@ cppReader_handleDirective (cppReader *pfile)
   struct directive *kt = NULL;
   int ident_length;
   size_t after_ident = 0;
-  char *ident, *line_end = NULL;
+  char *ident = NULL;
+  char *line_end = NULL;
   size_t old_written = cppReader_getWritten (pfile);
   int nspaces = cppSkipHspace (pfile);
 
@@ -1309,7 +1310,7 @@ cppReader_handleDirective (cppReader *pfile)
        }
 
       if (kt->length == ident_length
-         && (cstring_equalPrefix (kt->name, ident)))
+         && (cstring_equalPrefix (kt->name, cstring_fromChars (ident))))
        {
          break;
        }
@@ -3773,20 +3774,6 @@ get_directive_token (cppReader *pfile)
    I.e. in input file specification has been popped by cppReader_handleDirective.
    This is safe.  */
 
-# ifdef WIN32
-static void replace_unixdir_with_windir(char *filename)
-{
-  int i=0;
-  
-  while(filename[i] != '\0')
-    {
-      if(filename[i] == '/')
-       filename[i] = '\\';
-      i++;
-    }
-}
-# endif
-
 static int
 do_include (cppReader *pfile, struct directive *keyword,
            /*@unused@*/ char *unused1, /*@unused@*/ char *unused2)
@@ -4042,11 +4029,11 @@ do_include (cppReader *pfile, struct directive *keyword,
          DPRINTF (("fname: %s", fname));
          
          /* Win32 directory fix from Kay Buschner. */
-#ifdef WIN32
+#if defined (WIN32) || defined (OS2)
          /* Fix all unixdir slashes to win dir slashes */
          if (searchptr->fname && (searchptr->fname[0] != 0)) 
            {
-             replace_unixdir_with_windir(fname);
+             cstring_replaceAll (fname, '/', '\\');
            }
 #endif /* WIN32 */
 
@@ -4878,7 +4865,7 @@ beg_of_line:
        {
          cppIfStackFrame *temp;
          if (ident_length == kt->length
-             && cstring_equalPrefix (kt->name, ident))
+             && cstring_equalPrefix (kt->name, cstring_fromChars (ident)))
            {
              /* If we are asked to return on next directive, do so now.  */
              if (any)
@@ -6502,7 +6489,7 @@ void cppReader_initializeReader (cppReader *pfile) /* Must be done after library
 
   struct default_include *include_defaults = include_defaults_array;
 
-  /* Add dirs from CPATH after dirs from -I.  */
+  /* Add dirs from INCLUDEPATH_VAR after dirs from -I.  */
   /* There seems to be confusion about what CPATH should do,
      so for the moment it is not documented.  */
   /* Some people say that CPATH should replace the standard include dirs,
@@ -7227,6 +7214,7 @@ cpp_handleComment (cppReader *pfile, struct parse_marker *smark)
       int i;
       char c = ' ';
       char *scomment = start + 2;
+      char savec = start[len];
 
       start[0] = BEFORE_COMMENT_MARKER[0];
       start[1] = BEFORE_COMMENT_MARKER[1];
@@ -7242,6 +7230,19 @@ cpp_handleComment (cppReader *pfile, struct parse_marker *smark)
 
       cpp_setLocation (pfile);
 
+      start[len] = '\0';
+
+      if (mstring_containsString (scomment, "/*"))
+       {
+         (void) cppoptgenerror 
+           (FLG_NESTCOMMENT,
+            message ("Comment starts inside syntactic comment: %s", 
+                     cstring_fromChars (scomment)),
+            pfile);
+       }
+
+      start[len] = savec;
+
       if (mstring_equalPrefix (scomment, "ignore"))
        {
          if (!context_getFlag (FLG_NOCOMMENTS))
@@ -7547,7 +7548,7 @@ static bool cpp_skipIncludeFile (cstring fname)
       fname = removePreDirs (fname);
 
 # if defined (WIN32) || defined (OS2)
-      cstring_replaceAll (fname, '\\', '/');
+      cstring_replaceAll (fname, '/', '\\');
 # endif
 
       if (fileTable_exists (context_fileTable (), fname))
index 8909530d6ab62ca27457e3e2af3219a322ef18c6..272181e40fc4ab3de8e5d6e1ae95fb790087a0d3 100644 (file)
@@ -168,6 +168,7 @@ static void setTokLength (int len)
 {
   addColumn (len);
   tokLength = len;
+  DPRINTF (("Set tok length: %d", len));
 }
 
 static void setTokLengthT (size_t len)
@@ -439,6 +440,16 @@ L'(\\.|[^\\'])+'       { setTokLengthT (mstring_length (yytext));
 
 [ \t\v\f]      { incColumn (); }
 \n              { context_incLineno ();
+                  if (tokLength != 0) { 
+                   tokLength = 0; 
+                   /* No error to report 
+                   voptgenerror
+                     (FLG_SYNTAX, 
+                      message ("Likely parse error: token spans multiple lines."),
+                      g_currentloc);
+                   */
+                 }
+                 
                  if (continueLine)
                    {
                      continueLine = FALSE;
@@ -1228,7 +1239,6 @@ static bool processMacro (void)
     }
 
   hasParams = (c == '(');
-
   
   if (usymtab_exists (fname))
     {
@@ -1452,24 +1462,47 @@ static bool processMacro (void)
     {
       uentry ce;
 
-      voptgenerror 
-       (FLG_MACROMATCHNAME,
-        message ("Unexpanded macro %s does not match name of a constant "
-                 "or iter declaration.  The name used in the control "
-                 "comment on the previous line should match.  "
-                 "(Assuming macro defines a constant.)", 
-                 fname),
-        loc);
-
-
-      ce = uentry_makeConstant (fname, ctype_unknown, fileloc_undefined);      
-      uentry_setUsed (ce, loc); /* perhaps bogus? */
-      e2 = usymtab_supEntryReturn (ce);
-      
-      context_enterConstantMacro (e2);       
-      cstring_free (fname);
-      fileloc_free (loc);
-      return res;
+      /* evans 2001-09-09 - if it has params, assume a function */
+      if (hasParams)
+       {
+         voptgenerror 
+           (FLG_MACROMATCHNAME,
+            message ("Unexpanded macro %s does not match name of a declared "
+                     "function. The name used in the control "
+                     "comment on the previous line should match.",
+                     fname),
+            loc);
+         
+         ce = uentry_makeFunction (fname, ctype_unknown, 
+                                   typeId_invalid,
+                                   globSet_undefined,
+                                   sRefSet_undefined,
+                                   warnClause_undefined,
+                                   fileloc_undefined);      
+         uentry_setUsed (ce, loc); /* perhaps bogus? */
+         e2 = usymtab_supEntryReturn (ce);
+         context_enterUnknownMacro (e2);             
+       }
+      else
+       {
+         voptgenerror 
+           (FLG_MACROMATCHNAME,
+            message ("Unexpanded macro %s does not match name of a constant "
+                     "or iter declaration.  The name used in the control "
+                     "comment on the previous line should match.  "
+                     "(Assuming macro defines a constant.)", 
+                     fname),
+            loc);
+         
+         ce = uentry_makeConstant (fname, ctype_unknown, fileloc_undefined);      
+         uentry_setUsed (ce, loc); /* perhaps bogus? */
+         e2 = usymtab_supEntryReturn (ce);
+         
+         context_enterConstantMacro (e2);            
+         cstring_free (fname);
+         fileloc_free (loc);
+         return res;
+       }
     }
   
   /* in macros, ( must follow immediatetly after name */
@@ -1523,7 +1556,6 @@ static bool processMacro (void)
              sRef sr;
              
              param = uentry_nameCopy (paramname, decl);
-
                              
              uentry_setParam (param);
              sr = sRef_makeParam (paramno, uentry_getType (param), stateInfo_makeLoc (sloc));
@@ -1559,6 +1591,7 @@ static bool processMacro (void)
              param = uentry_makeVariableSrefParam 
                (paramname, ctype_unknown, fileloc_copy (sloc), 
                 sRef_makeParam (paramno, ctype_unknown, stateInfo_makeLoc (sloc)));
+             DPRINTF (("Unknown param: %s", uentry_unparseFull (param)));
              cstring_free (paramname);
 
              sRef_setPosNull  (uentry_getSref (param), sloc);
@@ -1675,7 +1708,7 @@ static bool handleSpecial (char *yyt)
   *l = '\0';
   olc = cstring_fromChars (ol);
   
-  if (cstring_equalPrefix (olc, "pragma"))
+  if (cstring_equalPrefixLit (olc, "pragma"))
     {
       char *pname = mstring_create (longUnsigned_fromInt (MAX_PRAGMA_LEN));
       char *opname = pname;
@@ -1733,7 +1766,7 @@ static bool handleSpecial (char *yyt)
          cstring_free (exname);
        }
     }
-  else if (cstring_equalPrefix (olc, "ident"))
+  else if (cstring_equalPrefixLit (olc, "ident"))
     {
       /* Some pre-processors will leave these in the code.  Ignore rest of line */
     }
@@ -1868,6 +1901,7 @@ static bool handleSpecial (char *yyt)
   
 static int handleLlSpecial ()
 { 
+  bool hasnl = FALSE;
   int ic; 
   char c;
   char *s = mstring_createEmpty ();
@@ -1929,6 +1963,20 @@ static int handleLlSpecial ()
             && (ic != AFTER_COMMENT_MARKER[0]))
        {
          c = (char) ic;
+
+         /* evans 2001-09-01 added to prevent assertion failures for uncloses syntactic comments */
+
+         if (c == '\n') {
+           hasnl = TRUE; /* This prevents tokLength from being set later. */
+           tokLength = 0; 
+
+           voptgenerror
+             (FLG_SYNTAX, 
+              message ("Likely parse error: syntactic comment token spans multiple lines: %s",
+                       cstring_fromChars (s)),
+              g_currentloc);
+         }
+
          s = mstring_append (s, c);
          charsread++;
        }
@@ -2137,7 +2185,7 @@ static int handleLlSpecial ()
 
       if (macrocode != BADTOK)
        {
-         tokLength = mstring_length (t);
+         tokLength = hasnl ? 0 : mstring_length (t);
          
          sfree (t);
          sfree (os);
@@ -2961,7 +3009,6 @@ static int
 processSpec (int tok)
 {
   size_t length = strlen (yytext);
-
   
   if (inSpecPart)
     {
index 2fb176afdc0e4d4233dd8a781cc5f6380a928d64..4d3048c8d841b56a91b45fc4f90a922e35ef3e73 100644 (file)
@@ -108,6 +108,12 @@ int cstring_toPosInt (cstring s)
   return val;
 }
 
+cstring cstring_afterChar (cstring s, char c) 
+{
+  llassert (cstring_isDefined (s));
+  return strchr (s, c);
+}
+
 cstring cstring_beforeChar (cstring s, char c)
 {
   if (cstring_isDefined (s))
@@ -188,7 +194,6 @@ bool cstring_containsChar (cstring c, char ch)
 ** Replaces all occurances of old in s with new.
 */
 
-# if defined (WIN32) || defined (OS2)
 void cstring_replaceAll (cstring s, char old, char snew)
 {
   
@@ -206,7 +211,6 @@ void cstring_replaceAll (cstring s, char old, char snew)
 
           }
 }
-# endif
 
 void cstring_replaceLit (/*@unique@*/ cstring s, char *old, char *snew)
 {
@@ -428,7 +432,7 @@ bool cstring_equalLenCaseInsensitive (cstring c1, cstring c2, int len)
   else return (cstring_genericEqual (c1, c2, len, TRUE, FALSE) != CGE_DISTINCT);
 }
 
-bool cstring_equalPrefix (cstring c1, char *c2)
+bool cstring_equalPrefix (cstring c1, cstring c2)
 {
   llassert (c2 != NULL);
 
@@ -440,7 +444,7 @@ bool cstring_equalPrefix (cstring c1, char *c2)
   return (strncmp (c1, c2, strlen (c2)) == 0);
 }
 
-bool cstring_equalCanonicalPrefix (cstring c1, char *c2)
+bool cstring_equalPrefixLit (cstring c1, const char *c2)
 {
   llassert (c2 != NULL);
 
@@ -449,78 +453,7 @@ bool cstring_equalCanonicalPrefix (cstring c1, char *c2)
       return (strlen (c2) == 0);
     }
 
-# if defined (WIN32) || defined (OS2)
-  /*
-  ** If one has a drive specification, but the other doesn't, skip it.
-  */
-  
-  if (strchr (c1, ':') == NULL
-      && strchr (c2, ':') != NULL)
-    {
-      c2 = strchr (c2 + 1, ':');
-    }
-  else 
-    {
-      if (strchr (c2, ':') == NULL
-         && strchr (c1, ':') != NULL)
-       {
-         c1 = strchr (c1 + 1, ':');
-       }
-    }
-
-  {
-    int len = size_toInt (strlen (c2));
-    int i = 0;
-    int slen = 0;
-
-    if (cstring_length (c1) < len)
-      {
-       return FALSE;
-      }
-
-    for (i = 0; i < len; i++)
-      {
-       if (c1[slen] == c2[i]
-           || (osd_isConnectChar (c1[slen]) && osd_isConnectChar (c2[i])))
-         {
-           ;
-         }
-       else 
-         {
-           /*
-           ** We allow \\ to match \ because MS-DOS screws up the directory
-           ** names.
-           */
-           
-           if (c1[slen] == '\\'
-               && (slen > 0
-                   && c1[slen - 1] == '\\'
-                   && c2[i - 1] == '\\'))
-             {
-               slen++;
-               if (c1[slen] != c2[i])
-                 {
-                   return FALSE;
-                 }
-             }
-           else
-             {
-               return FALSE;
-             }
-         }
-
-       slen++;
-       if (slen >= cstring_length (c1))
-         {
-           return FALSE;
-         }
-      }
-  }
-
-  return TRUE;
-# else
   return (strncmp (c1, c2, strlen (c2)) == 0);
-# endif
 }
 
 int cstring_xcompare (cstring *c1, cstring *c2)
index 3f1260e8f0661d7ff973fea1585b49d05bade831..deb09fb35b6d161e9903c2b0352e87857a09feec 100644 (file)
@@ -1086,6 +1086,9 @@ exprNode_arrayFetch (/*@only@*/ exprNode e1, /*@only@*/ exprNode e2)
   ** error in ind, assume valid and continue
   */
 
+  DPRINTF (("Array fetch: %s / %s",
+           exprNode_unparse (e1), exprNode_unparse (e2)));
+
   if (exprNode_isError (e1))
     {
       exprNode_free (e2);
@@ -1103,7 +1106,9 @@ exprNode_arrayFetch (/*@only@*/ exprNode e1, /*@only@*/ exprNode e2)
       ** lclint errors.  Hence, the i2 comments.
       */
 
-      if (!ctype_isRealArray (crarr) 
+      /* evans 2001-09-09 added ctype_isKnown so there is no swap when e1 type is unknown */
+      if (ctype_isKnown (crarr)
+         && !ctype_isRealArray (crarr) 
          && ctype_isRealNumeric (crarr) 
          && !exprNode_isError (e2)
          && ctype_isRealAP (exprNode_getType (e2)))  /* fetch like 3[a] */
@@ -1120,6 +1125,8 @@ exprNode_arrayFetch (/*@only@*/ exprNode e1, /*@only@*/ exprNode e2)
          ind = e2;
        }
 
+      DPRINTF (("arr: %s", exprNode_unparse (arr)));
+
       if (sRef_possiblyNull (arr->sref))
         {
           if (!usymtab_isGuarded (arr->sref))
@@ -1131,6 +1138,7 @@ exprNode_arrayFetch (/*@only@*/ exprNode e1, /*@only@*/ exprNode e2)
                                        exprNode_unparse (arr)),
                               arr->loc))
                {
+                 DPRINTF (("ref: %s", sRef_unparseFull (arr->sref)));
                  sRef_showNullInfo (arr->sref);
 
                  /* suppress future messages */
@@ -8152,7 +8160,7 @@ exprNode exprNode_iter (/*@observer@*/ uentry name,
     {
       cstring ename = uentry_getName (end);
 
-      if (!cstring_equalPrefix (ename, "end_"))
+      if (!cstring_equalPrefixLit (ename, "end_"))
        {
          llerror (FLG_ITER, message ("Iter %s not balanced with end_%s: %s", 
                                      iname, iname, ename));
index c023e08ae7e2fea5d7a401382fc54b4edad6a5a0..14d2dc02888bc9d73266115253256982d9ce009c 100644 (file)
@@ -220,7 +220,7 @@ bool isHeaderFile (cstring fname)
 
 cstring fileLib_cleanName (cstring s)
 {
-  if (cstring_equalPrefix (s, "./")) 
+  if (cstring_equalPrefixLit (s, "./")) 
     {
       return cstring_copySegment (s, 2, cstring_length (s) - 1);
     }
index 4816217014fdd503754158db24a8fd059444795d..ddc2846075b2c7f1c8dd94ba2a4d3154421addfb 100644 (file)
@@ -442,14 +442,9 @@ fileTable_addMetastateFile (fileTable ft, cstring name)
 fileId
 fileTable_addCTempFile (fileTable ft, fileId fid)
 {
-# if FALSE
-  /* Can't control output file name for cl preprocessor */
-  cstring newname = cstring_concatChars (fileLib_removeAnyExtension (fileName (fid)), ".i");
-# else
   cstring newname =
     makeTempName (context_tmpdir (), cstring_makeLiteralTemp ("cl"), 
                  C_EXTENSION);
-# endif
 
   llassert (fileTable_isDefined (ft));
 
index 991fd9e5c65f741f30dbc909bf6126162334b08d..0301a1fb7af95226ad26901561f576ede1e4a751 100644 (file)
@@ -48,7 +48,7 @@ static flkind fileId_kind (fileId s)
     {
       return (FL_SPEC);
     }
-  else if (cstring_equalPrefix (fname, SYSTEM_LIBDIR))
+  else if (cstring_equalPrefix (fname, cstring_makeLiteralTemp (SYSTEM_LIBDIR)))
     {
       return (FL_STDHDR); 
     }
@@ -62,6 +62,7 @@ fileloc
 fileloc_decColumn (fileloc f, int x)
 {
   fileloc ret = fileloc_copy (f);
+
   if (x > 0 && fileloc_isDefined (ret))
     {
       llassertprint (ret->column > x, ("decColumn: %d", x));
@@ -457,7 +458,7 @@ fileloc_createLib (cstring ln)
       fid = fileTable_addLibraryFile (context_fileTable (), ln);
     }
 
-  if (cstring_equalPrefix (ln, SYSTEM_LIBDIR))
+  if (cstring_equalPrefix (ln, cstring_makeLiteralTemp (SYSTEM_LIBDIR)))
     {
       fk = FL_STDLIB;
     }
index ffd23680659065a11b7c1afef5806047c467a454..1eac6069a94217603ab1eccc5d57dc47f0c502dc 100644 (file)
@@ -245,6 +245,18 @@ bool mstring_containsChar (const char *s, char c)
       return FALSE;
     }
 }
+
+bool mstring_containsString (const char *s, const char *c)
+{
+  if (mstring_isDefined (s))
+    {
+      return (strstr (s, c) != NULL);
+    }
+  else
+    {
+      return FALSE;
+    }
+}
  
 char *mstring_concat (const char *s1, const char *s2)
 {
index 0de423d15ce6218dd9e9a065dcce02f6f86f5ddc..5a776e2aa9a9578b6692a40a34bad8e63dfdfbc3 100644 (file)
@@ -1 +1,2 @@
-3.0.0.13
+3.0.0.16
+
index 8ff3067160e8630e9ed204adcfdae2c58814653c..7bdc921ae707b329c10a840e170bf13f1dc65a4a 100644 (file)
@@ -1,7 +1,7 @@
 -IHeaders 
 -DDEBUGPRINT
 
-## -systemdirs /usr/include:/usr/local/lib/
+-systemdirs /usr/include:/usr/local/lib/:/usr/lib
 
 +allmacros # check all macros
 +checks    # checks mode (moderately strict checking)
index 8340ea3b0df77dbf35d71d393dcdfb41e1b9b18e..5027191e2fbed8c13a153d2dbbec00de233a00fd 100644 (file)
@@ -688,6 +688,16 @@ int main (int argc, char *argv[])
            /*@noaccess cstring@*/
          }
       }
+    else /* 2001-09-09: herbert */
+      {
+       /* Put C_INCLUDE_PATH directories in sysdirs */
+       cstring cincval = osd_getEnvironmentVariable (cstring_makeLiteralTemp ("C_INCLUDE_PATH"));
+       if (cstring_isDefined (cincval))
+         {
+           context_setString (FLG_SYSTEMDIRS, cstring_copy (cincval));
+         }
+      }
+    /* /herbert */
 
     cstring_free (oincval);
   }
@@ -1069,6 +1079,19 @@ int main (int argc, char *argv[])
        {
          addXHFile (xfiles, cstring_copy (current));
        }
+      else if (cstring_equal (ext, PP_EXTENSION))
+       {
+         if (!context_getFlag (FLG_NOPP))
+           {
+             voptgenerror 
+               (FLG_FILEEXTENSIONS,
+                message ("File extension %s used without +nopp flag (will be processed as C source code): %s", 
+                         ext, current),
+                g_currentloc);
+           }
+         
+         addFile (cfiles, cstring_copy (current));
+       }
       else if (cstring_equal (ext, LCL_EXTENSION)) 
        {
          addFile (lclfiles, cstring_copy (current));
@@ -2027,7 +2050,7 @@ describeVars (void)
   llmsglit ("   --- path used to find #include'd files");
 
   llmsg (message 
-        ("systemdirs = %s (set by -systemdirs or envirnoment variable %s)", /*@i413223@*/
+        ("systemdirs = %s (set by -systemdirs or environment variable %s)", /*@i413223@*/
          context_getString (FLG_SYSTEMDIRS),
          INCLUDEPATH_VAR));
 
index 318ce0943e37669e7aa42c96f9b99c8f17c8fad4..ce2f8c73e5fb89b10c765e3c5f7633c2f2e116e1 100644 (file)
 extern ctype mtscanner_lookupType (mttok p_tok) /*@modifies p_tok@*/ ;
 # endif
 
-  /*@i523 can't include these here
+  /*@i523@*/ /* can't include these here
     # include "mtgrammar.h"
     # include "mtscanner.h"
   */
index 2a1cd4c4c3b9a556d06f5a8afd1e11615b5d6f8c..5a5861211d14773a52ddc40254a81757f387b40d 100644 (file)
@@ -32,7 +32,7 @@
 extern ctype mtscanner_lookupType (mttok p_tok) /*@modifies p_tok@*/ ;
 # endif
 
-  /*@i523 can't include these here
+  /*@i523@*/ /* can't include these here
     # include "mtgrammar.h"
     # include "mtscanner.h"
   */
index be98be77505cdcd9f5d9cc538908c6c40ae8cec8..e6bfe8697267780e2c1c5b9bcdb763acfad21668 100644 (file)
@@ -1395,30 +1395,30 @@ checkAnsiName (uentry ue)
       if ((cstring_lastChar (name) == 'f' || cstring_lastChar (name) == 'l')
          && 
          (((length == 4)
-           && ((cstring_equalPrefix (name, "cos") ||
-                cstring_equalPrefix (name, "sin") ||
-                cstring_equalPrefix (name, "tan") ||
-                cstring_equalPrefix (name, "exp") ||
-                cstring_equalPrefix (name, "log") ||
-                cstring_equalPrefix (name, "pow"))))
+           && ((cstring_equalPrefixLit (name, "cos") ||
+                cstring_equalPrefixLit (name, "sin") ||
+                cstring_equalPrefixLit (name, "tan") ||
+                cstring_equalPrefixLit (name, "exp") ||
+                cstring_equalPrefixLit (name, "log") ||
+                cstring_equalPrefixLit (name, "pow"))))
           || ((length == 5)
-              && ((cstring_equalPrefix (name, "acos") ||
-                   cstring_equalPrefix (name, "asin") ||
-                   cstring_equalPrefix (name, "atan") ||
-                   cstring_equalPrefix (name, "cosh") ||
-                   cstring_equalPrefix (name, "sinh") ||
-                   cstring_equalPrefix (name, "sqrt") ||
-                   cstring_equalPrefix (name, "ceil") ||
-                   cstring_equalPrefix (name, "fabs") ||
-                   cstring_equalPrefix (name, "fmod") ||
-                   cstring_equalPrefix (name, "tanh") ||
-                   cstring_equalPrefix (name, "modf"))))
+              && ((cstring_equalPrefixLit (name, "acos") ||
+                   cstring_equalPrefixLit (name, "asin") ||
+                   cstring_equalPrefixLit (name, "atan") ||
+                   cstring_equalPrefixLit (name, "cosh") ||
+                   cstring_equalPrefixLit (name, "sinh") ||
+                   cstring_equalPrefixLit (name, "sqrt") ||
+                   cstring_equalPrefixLit (name, "ceil") ||
+                   cstring_equalPrefixLit (name, "fabs") ||
+                   cstring_equalPrefixLit (name, "fmod") ||
+                   cstring_equalPrefixLit (name, "tanh") ||
+                   cstring_equalPrefixLit (name, "modf"))))
           || ((length == 6)
-              && ((cstring_equalPrefix (name, "atan2") ||
-                   cstring_equalPrefix (name, "floor") ||
-                   cstring_equalPrefix (name, "frexp") ||
-                   cstring_equalPrefix (name, "ldexp") ||
-                   cstring_equalPrefix (name, "log10"))))))
+              && ((cstring_equalPrefixLit (name, "atan2") ||
+                   cstring_equalPrefixLit (name, "floor") ||
+                   cstring_equalPrefixLit (name, "frexp") ||
+                   cstring_equalPrefixLit (name, "ldexp") ||
+                   cstring_equalPrefixLit (name, "log10"))))))
        {
          hasError |= optgenerror2
            (flg, FLG_NAMECHECKS,
@@ -1519,7 +1519,7 @@ void checkParamNames (uentry ue)
                {
                  cstring pname = uentry_observeRealName (p);
                  
-                 if (!cstring_equalPrefix (pname, cstring_toCharsSafe (fpfx)))
+                 if (!cstring_equalPrefix (pname, fpfx))
                    {
                      if (context_getFlag (FLG_NAMECHECKS))
                        {
index 59961d256ef6f6c79d5b16f0edb7384be29c1178..8dc548238255023e4527440bde3af1212ffaade7 100644 (file)
--- a/src/osd.c
+++ b/src/osd.c
@@ -565,3 +565,86 @@ bool osd_isConnectChar (char c)
   return FALSE;
 }
 
+/*
+** Returns true if c2 starts with the same path as c1
+**
+** This is called by context_isSystemDir to determine if a
+** directory is on the system path.
+**
+** In unix, this is just a string comparison.  For Win32 and OS2, we need a more
+** complex comparison.
+*/
+
+bool osd_equalCanonicalPrefix (cstring dirpath, cstring prefixpath)
+{
+  llassert (cstring_isDefined (prefixpath));
+
+  if (cstring_isEmpty (dirpath)) 
+    {
+      return (cstring_isEmpty (prefixpath));
+    }
+
+# if defined (WIN32) || defined (OS2)
+
+  /*@access cstring@*/ /* Moved this from cstring - should abstract it... */
+
+  /*
+  ** If one has a drive specification, but the other doesn't, skip it.
+  */
+  
+  if (strchr (dirpath, ':') == NULL
+      && strchr (prefixpath, ':') != NULL)
+    {
+      prefixpath = strchr (prefixpath, ':') + 1;
+    }
+  else 
+    {
+      if (strchr (prefixpath, ':') == NULL
+         && strchr (dirpath, ':') != NULL)
+       {
+         dirpath = strchr (dirpath, ':') + 1;
+       }
+    }
+
+  {
+    int len = size_toInt (strlen (prefixpath));
+    int i = 0;
+    int slen = 0;
+
+    for (i = 0, slen = 0; i < len; i++, slen++)
+      {
+       /* Allow any number of connect characters in any combination:
+        * c:/usr//src\/foo == c:\\usr/src\/foo 
+        * After this we'll be at the last of such a sequence */
+
+       if (osd_isConnectChar (dirpath[slen]) && osd_isConnectChar (prefixpath[i]))
+         {
+           /* Skip one or more connect chars */
+
+           for (; osd_isConnectChar (dirpath[slen+1]); ++slen)
+             {
+               ; 
+             }
+           
+           for (; osd_isConnectChar (prefixpath[i+1]); ++i)
+             {
+               ;
+             }
+         }
+       /* Windows, MSDOS and OS/2 use case-insensitive path specs! */
+       else if (toupper (dirpath[slen]) != toupper (prefixpath[i]))
+         {
+           return FALSE;
+         }
+
+      }
+  }
+
+  /*@noaccess cstring@*/ 
+
+  return TRUE;
+# else
+  return (cstring_equalPrefix (dirpath, prefixpath));
+# endif
+}
+
index c41899aea295ca4a1e4dda378972b6f3bb116165..31bd5717f925f5601fbda8ba7b1dab90b33a7ab3 100644 (file)
@@ -717,6 +717,14 @@ void sRef_clearGlobalScopeSafe ()
 
 void sRef_enterFunctionScope ()
 {
+  /* evans 2001-09-09 - cleanup if we are in a macro! */
+  if (context_inMacro ())
+    {
+      if (inFunction) {
+       sRef_exitFunctionScope ();
+      }
+    }
+
   llassert (!inFunction);
   llassert (sRefTable_isEmpty (allRefs));
   inFunction = TRUE;
@@ -4854,10 +4862,7 @@ void sRef_clearAliasState (sRef s, fileloc loc)
 void sRef_setAliasKindComplete (sRef s, alkind kind, fileloc loc)
 {
   sRef_checkMutable (s);  
-  /*@+enumint*/ /* we allow alkind to match int for this */
-  sRef_aliasSetCompleteParam (sRef_setAliasKind, s, kind, loc); 
-  /* gcc give warning for this, should provide typesafe versions of aliasSetCompleteParam */
-  /*@=enumint@*/
+  sRef_aliasSetCompleteAlkParam (sRef_setAliasKind, s, kind, loc); 
 }
 
 void sRef_setAliasKind (sRef s, alkind kind, fileloc loc)
@@ -8281,7 +8286,39 @@ sRef_aliasSetCompleteParam (void (predf) (sRef, int, fileloc), sRef s,
                            int kind, fileloc loc)
 {
   sRefSet aliases;
+  
+  if (sRef_isDeep (s))
+    {
+      aliases = usymtab_allAliases (s);
+    }
+  else
+    {
+      aliases = usymtab_aliasedBy (s);
+    }
+
+  (*predf)(s, kind, loc);
+
+  sRefSet_realElements (aliases, current)
+    {
+      if (sRef_isValid (current))
+       {
+         current = sRef_updateSref (current);
+         ((*predf)(current, kind, loc));
+       }
+    } end_sRefSet_realElements;
 
+  sRefSet_free (aliases);
+}
+
+/*
+** Version of aliasSetCompleteParam for alkind parameters
+*/
+
+void
+sRef_aliasSetCompleteAlkParam (void (predf) (sRef, alkind, fileloc), sRef s, 
+                              alkind kind, fileloc loc)
+{
+  sRefSet aliases;
   
   if (sRef_isDeep (s))
     {
@@ -8950,6 +8987,8 @@ extern /*@exposed@*/ sRef sRef_makeArrow (sRef s, /*@dependent@*/ cstring f)
   
   p = sRef_makePointer (s);
   ret = sRef_makeField (p, f);
+  DPRINTF (("Arrow: %s => %s",
+           sRef_unparseFull (s), sRef_unparseFull (ret)));
   return ret;
 }
 
index 054d456c13dc70993eb8394a547e9e2e08ec721b..6ee16e49bdef2f5c96a87a6f27ba5bd76fb42919 100644 (file)
@@ -3574,7 +3574,8 @@ uentry_setGlobals (uentry ue, /*@owned@*/ globSet globs)
       /*@=mustfree@*/
     }
 
-  /*@i23 ??? 
+  /*@i23*/
+  /* ???  - evans 2001-09-09 not sure what's going on here...?
   if (globSet_hasStatic (globs))
     {
       context_recordFileGlobals (globs);
@@ -6144,7 +6145,7 @@ sRef uentry_getSref (uentry e)
 
 sRef uentry_getOrigSref (uentry e)
 {
-  /*@i523
+  /*@i523*/ /* evans 2001-09-09 - need to fix this 
   if (uentry_isValid (e))
     {
       if (uentry_isVariable (e))
@@ -8349,7 +8350,7 @@ checkFunctionConformance (/*@unique@*/ /*@notnull@*/ uentry old,
                      cstring nnamefix;
 
                      if (cstring_isDefined (pfx)
-                         && cstring_equalPrefix (oldname, cstring_toCharsSafe (pfx)))
+                         && cstring_equalPrefix (oldname, pfx))
                        {
                          oname = cstring_suffix (oldname, cstring_length (pfx));
                        }
@@ -8359,7 +8360,7 @@ checkFunctionConformance (/*@unique@*/ /*@notnull@*/ uentry old,
                        /*@-branchstate@*/ } /*@=branchstate@*/
 
                      if (cstring_isDefined (pfx)
-                         && cstring_equalPrefix (nname, cstring_toCharsSafe (pfx)))
+                         && cstring_equalPrefix (nname, pfx))
                        {
                          nnamefix = cstring_suffix (nname, cstring_length (pfx));
                        }
index 25fc641c8695d78b2e6f244d98b0dd723e300556..002380196016ed0b3b25886978df0b3f806a98bc 100644 (file)
@@ -851,8 +851,8 @@ uentryList_matchFields (uentryList p1, uentryList p2)
       cp1 = p1->elements[index];
       cp2 = p2->elements[index];
 
-      /*@i32
-      **
+      /*@i32*/
+      /*
       ** Should compare uentry's --- need to fix report errors too.
       */
 
index f65f7582644462b6f4d49c1ecc64f1295525f860..64cb20fa9d5544afffb0ba4e1bdc0abef851a6cf 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index 11c1453f918bb37b0eb694976727029414c66d76..000dc4d4564cfa62ebb5d192da78410c211e8ef1 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index a83434e4861ef1312afaa6e5f98f52d58341c940..6fbd7d41fbfa439c6f73b685c169656be21f9ad6 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index 84ce58fe7b551904eba4203c42b19c4afe47e21e..528a56527ac0f98865f95d74860b0d0e3f68b16b 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index a75fb77d129028549b29431ee35547bbaba3aeef..050bf2316deb0b89f04901ee48525548d19b935a 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index ca33667fc2122e5b039b20e1c7b6372266d791f9..cafd3e26e8f4961751a1a88f90cf62dd789d12d0 100644 (file)
@@ -1,4 +1,4 @@
-/* Output from LCLint 3.0.0.13 */
+/* Output from LCLint 3.0.0.16 */
 # include "bool.h"
 
 
index ad5f9a202f5a41d14f8fef4a72cb74aa14232f5d..a78b2d570f72deedc3b465b784f67370d520e85d 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index ddc51350919b9338dc68c3223d1e0a16f6732468..f607d04a32685ee9728ad4d259dbbf934756a1b7 100644 (file)
@@ -1,4 +1,4 @@
-/* Output from LCLint 3.0.0.13 */
+/* Output from LCLint 3.0.0.16 */
 
 # include "bool.h"
 # include "mut.h"
index e60d004dfbb2ce7b66e6b7e57a79b74058e63652..72d4d2afa2e91598d44b3fcba7b55e3e63388c37 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index 7adf356f8858a7690e287266b5bcc663f5d78547..d4bd5305d23a2e67cf47cf64451cf134669496c0 100644 (file)
@@ -1,4 +1,4 @@
-/* Output from LCLint 3.0.0.13 */
+/* Output from LCLint 3.0.0.16 */
 # include "bool.h"
 
 
index 31515b28c280e7e243c755c91bedee7a0af42031..3cd0db55de732c8df7c2932058936fad3b6dbaef 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index ca8e6dfcd6922bbf8e2165153338eea79411dd39..f08d8db0c419edfeec52f2592a09ecdf33debd9d 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index 32a2ba8c7a349910f2b9c4fc146360cbc85a9391..361e69479d4ca5e54279dc262a683a31aa8d89bf 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index 75b8331e1f47a9ef39635ef6681a4cbf784efdc8..4b0d2ee9c0b5c83390a3bb94cdd0ff90fa071056 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index 298f817024ce1921f83edc05e1f4a7adf7cc8390..ff3e9082f6cd0530efc4dbe163ee19eb7d1e6914 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index aef48d62e5bab1664ed3e129adb6b391492e35b9..edc96e1d4486d702f5583972cc239493caf59092 100644 (file)
@@ -1,4 +1,4 @@
-/* Output from LCLint 3.0.0.13 */
+/* Output from LCLint 3.0.0.16 */
 # include "bool.h"
 
 
index 170420c5ff6051fbfb18890546ee94465fb0b1fe..c020e9d0d2e882ccb2de60e59dea28d98c19cc76 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index 8e6fb7013af4eafaf2f560e61ccaa5c043357821..463929c4f05a26c300c71753a8ea24b4dfdbcd99 100644 (file)
@@ -1,4 +1,4 @@
-/* Output from LCLint 3.0.0.13 */
+/* Output from LCLint 3.0.0.16 */
 
 # include <stdio.h>
 # include "bool.h"
index 562a1cbca85387f098c8e167d0e85579a681a30c..1004239bfef588314ea8975d60f21082b6deafd5 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index 44d371618252dfcf3fc25953c15ccd83953f421f..9d4e57303480222a5f9581270c74e6e73b42be32 100644 (file)
@@ -1,4 +1,4 @@
-/* Output from LCLint 3.0.0.13 */
+/* Output from LCLint 3.0.0.16 */
 
 # include "bool.h"
 # include "bool.h"
index ee3094ac4e5f41d26524607e76a973ad6ace315f..6bd2eb933fd9ef064e9be91af33680d2751cc5cf 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index 1e1e60ae7bad4a95322d8c74e4a75deb04608caa..2eb4bfe6904cee6c6b63903a3f4c6d975fed8031 100644 (file)
@@ -1,4 +1,4 @@
-/* Output from LCLint 3.0.0.13 */
+/* Output from LCLint 3.0.0.16 */
 
 # include "bool.h"
 # include "employee.h"
index 2cc8204d32e4d0ba479fb3e29f8b69b14e8630dc..1ffc2e8e13e39290c7809017bb612fcce00a9e2c 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index e21113a414a4a5ddbae1144b3d5db9ec40bdeb9d..61716fed622e8c90a75478a2010b9d844af7008b 100644 (file)
@@ -1,4 +1,4 @@
-/* Output from LCLint 3.0.0.13 */
+/* Output from LCLint 3.0.0.16 */
 
 # include "bool.h"
 # include "eref.h"
index 193fb2e3d112cfb92e488c65966fba72e0c5908e..2b8f65309514a366dbc348b3d607fe1bd1931e3d 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index ace3e78812dc3a4ce56b9f196f88c461d8a91627..fbbb433176685bf2e4f7d91b4c3d71b6db46e172 100644 (file)
@@ -1,4 +1,4 @@
-/* Output from LCLint 3.0.0.13 */
+/* Output from LCLint 3.0.0.16 */
 
 # include "bool.h"
 # include "employee.h"
index d2d2bc39ec48d6745eb46d68858d06b7f7b5bd98..f25c16225e504fd51d2ce615f88a40e7545bef1a 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index 824f447640338e3176c554b585809db08ddaae1f..d89a7f99c3099666a8dbf3e658ad8ead2ceca389 100644 (file)
@@ -1,4 +1,4 @@
-/* Output from LCLint 3.0.0.13 */
+/* Output from LCLint 3.0.0.16 */
 
 # include "bool.h"
 # include "employee.h"
index daf899408c3762f377386543905c5098072b57e8..9eed1117406230947503b3b4a9134ad1acc59d88 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index 8e6fb7013af4eafaf2f560e61ccaa5c043357821..463929c4f05a26c300c71753a8ea24b4dfdbcd99 100644 (file)
@@ -1,4 +1,4 @@
-/* Output from LCLint 3.0.0.13 */
+/* Output from LCLint 3.0.0.16 */
 
 # include <stdio.h>
 # include "bool.h"
index 3b21a08164ee7b9aed58976b9e91c5d7a6797c09..cd75b5ccf50c2394d9e965bf9375b9e58e8e4e57 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index f9df753fb0553caa2886a2f232e3c51cc91d0bc9..512280994b51122e36a43a893c6f59e2fa7bf746 100644 (file)
@@ -1,4 +1,4 @@
-/* Output from LCLint 3.0.0.13 */
+/* Output from LCLint 3.0.0.16 */
 
 # include <stdio.h>
 # include "bool.h"
index a85292b81e6193603aebd5aa0a4e41abbb95ccf7..72740fde28ac806ff4fc9c2d049f59956009f3bb 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index 6fa061f0b55fe0ece05a118afbc3e41eb7771571..42c501ff7c344b2289bb2bcbeca9dce8fc4a97b6 100644 (file)
@@ -1,4 +1,4 @@
-/* Output from LCLint 3.0.0.13 */
+/* Output from LCLint 3.0.0.16 */
 
 # include "bool.h"
 # include "employee.h"
index 494dab231d7cd406d64efe71860ad3ac093b5b7e..ca90e1b16b0e94415c04416a6a1b1b217a87f4be 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index 1ec409c1695ff340502bf942193f71d0bd7a9a99..d0182bbbc7bd2b15d55f17bbd3e27b8b3815e77b 100644 (file)
@@ -1,4 +1,4 @@
-/* Output from LCLint 3.0.0.13 */
+/* Output from LCLint 3.0.0.16 */
 
 # include "bool.h"
 # include "eref.h"
index 989bca581dc25175e89e0a06dd2aa8a3beba009f..adb51c26579119e612b0909ce99a9044cc91db50 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index ace3e78812dc3a4ce56b9f196f88c461d8a91627..fbbb433176685bf2e4f7d91b4c3d71b6db46e172 100644 (file)
@@ -1,4 +1,4 @@
-/* Output from LCLint 3.0.0.13 */
+/* Output from LCLint 3.0.0.16 */
 
 # include "bool.h"
 # include "employee.h"
index 3b00914475a901a38c9798c9810af5a500717952..7989f3d0bf7f4bfe2fa3c6c7d6c185ced34a7384 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index 824f447640338e3176c554b585809db08ddaae1f..d89a7f99c3099666a8dbf3e658ad8ead2ceca389 100644 (file)
@@ -1,4 +1,4 @@
-/* Output from LCLint 3.0.0.13 */
+/* Output from LCLint 3.0.0.16 */
 
 # include "bool.h"
 # include "employee.h"
index 5aae1664883e7f79f56d14d410ca8490b1a1e036..d1189fcef3102b562620f5dac01f5edaadfbadff 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index e227d3938f50cef03eedfaae083098a549f59952..9912f6c290bf8c98d14a734b756773da0af2fd84 100644 (file)
@@ -1,4 +1,4 @@
-/* Output from LCLint 3.0.0.13 */
+/* Output from LCLint 3.0.0.16 */
 # include "bool.h"
 
 
index b9f1ebdac16eea9ddc10e69ad4188b23e7911e1e..4d336283c70a71456eeffb2e24c0abe5a10d2a24 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index ec85122c0fc5dcc9027648d2f57579e2d0590088..5562f76fcfddbf03e1f517a3f5ee49e7f8825844 100644 (file)
@@ -1,4 +1,4 @@
-/* Output from LCLint 3.0.0.13 */
+/* Output from LCLint 3.0.0.16 */
 
 # include "bool.h"
 # include "bool.h"
index fed73372029f57d2b78e00662ff707bf6f489c28..3deebc3a579c176bceb523ca1215f504d859f657 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index cf0beccb817e3c99dcdbdf1af05d81924e47d8c2..3f8de16dcbdc84e781fccab901202be08b86fb7c 100644 (file)
@@ -1,4 +1,4 @@
-/* Output from LCLint 3.0.0.13 */
+/* Output from LCLint 3.0.0.16 */
 
 # include <stdio.h>
 # include "bool.h"
index 6203f2bc0092265c38d44009e9a50c6a8287f02b..19dc9780658d47c414608f0013da4583279d30c6 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index 87f7679a79dccbc4f00a01b0f12b485073af41c8..fdb1ec90b5a90e8172e124b7b0811eb15386cefb 100644 (file)
@@ -1,4 +1,4 @@
-/* Output from LCLint 3.0.0.13 */
+/* Output from LCLint 3.0.0.16 */
 
 # include <stdio.h>
 # include "bool.h"
index 4c4b8383df76f0b581486d1a7e33412b347429cf..2627697fc6bf6b66be352682d93a7625aaca463d 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index e67dee6b6c6bb9bdbdaa9d8e0f7ed7c06480890d..73ce4876fc24deb0d270969fe20a97ad5fcac492 100644 (file)
@@ -1,4 +1,4 @@
-/* Output from LCLint 3.0.0.13 */
+/* Output from LCLint 3.0.0.16 */
 
 # include "bool.h"
 # include "employee.h"
index 6e2023efee50144a33aa468d4274a86c1ba3d333..835dcb857657f0183d844f70a82c5ce101bd3d6c 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index fc19ad3e1c253e32501273da900e859d66c71291..fe1b3ce2b9b5b1327919b27b4e677acbd6fc52f1 100644 (file)
@@ -1,4 +1,4 @@
-/* Output from LCLint 3.0.0.13 */
+/* Output from LCLint 3.0.0.16 */
 
 # include "bool.h"
 # include "eref.h"
index e9404701368f35f7c508780fef2adc5967a72117..c345da909eebd89b0bb46024bca03bfa8b84a079 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index fefd5347116873a2b7c27640bc5e2152a759c4f6..c37914975853696cbde121c27ad8cbfd900e5ba7 100644 (file)
@@ -1,4 +1,4 @@
-/* Output from LCLint 3.0.0.13 */
+/* Output from LCLint 3.0.0.16 */
 
 # include "bool.h"
 # include "employee.h"
index 8f892e1e066d2a0c607cebaa9350597162cb0c8a..1539ab6dab057e9b7a6cc123200345ffb060dbb3 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index e042bece2069df6bd201073a12aa16a7b880bead..dcce7946a907b3d816ce2e0da1f5999903a1908e 100644 (file)
@@ -1,4 +1,4 @@
-/* Output from LCLint 3.0.0.13 */
+/* Output from LCLint 3.0.0.16 */
 
 # include "bool.h"
 # include "employee.h"
index f45af0ddc1a36b2fe646b435853cd5b495dc3cdd..6cf4f060baa180a5e8423c071f275435bee475c9 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index b84cb191e21eeaeacce32712cb782edfacaaaa28..e56e45f5faad2375fc5388ca25986261ea861a00 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
diff --git a/test/fileio/file.c b/test/fileio/file.c
new file mode 100644 (file)
index 0000000..6820a8e
--- /dev/null
@@ -0,0 +1,26 @@
+extern FILE *f1;
+
+FILE *f (FILE *fin, FILE *fout)
+     /*@ensures closed fin@*/
+{
+  FILE *res;
+  int x;
+
+  x = fgetc (fin);
+
+  if (x > 65)
+    {
+      (void) fclose (fout);
+    } /* merge incompatible */
+
+  if (x > 65)
+    {
+      ;
+    }
+  else
+    {
+      (void) fclose (fin);
+    } /* merge incompatible */
+
+  return res;
+}
diff --git a/test/fileio/filebranch.c b/test/fileio/filebranch.c
new file mode 100644 (file)
index 0000000..8cd6668
--- /dev/null
@@ -0,0 +1,12 @@
+void f (char *fname)
+{
+  FILE *f;
+
+  if (fname != NULL)
+    {
+      f = fopen (fname, "r");
+      if (f != NULL) {
+       (void) fclose (f);
+      }
+    }
+}
index 4e18dc471df339a2f9ba0b2be151380561d3f89d..add3dd9214b9bcdff75944c463a49578c3ea5166 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index adbec4d4b1f0c2131714de8319bdfd12c9deef53..ed45dee9577a7de1ba90ed4438e62c6dac49b0d6 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index f777a122ca61838c46ff7d7930f6530a3fd7a698..8b134915dca70f628312adb6efeeef36edaf8f75 100644 (file)
@@ -1,4 +1,4 @@
-%FAILED Output from LCLint 3.0.0.13
+%FAILED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index d4d1f4f80fa1dc99865683f8bf4ada934838e2d4..dbe8e85c08b05b037c4668cbf04239732caaab29 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index d5e67124038be7e9dbb355bbd41f180e46e0a503..575906dda3b4a06604400d96a7ea4510b1882bae 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
diff --git a/test/mergestate/tainted.mts b/test/mergestate/tainted.mts
new file mode 100644 (file)
index 0000000..4878c11
--- /dev/null
@@ -0,0 +1,21 @@
+attribute taintedness
+   context reference char *
+   oneof untainted, tainted
+   annotations
+      tainted reference ==> tainted
+      untainted reference ==> untainted
+   transfers
+      tainted as untainted ==> error "Possibly tainted storage used as untainted."
+      untainted as tainted ==> untainted
+   merge
+      tainted + untainted ==> tainted
+   defaults 
+      reference ==> tainted
+      parameter ==> tainted
+      result ==> tainted
+      literal ==> untainted
+      null ==> untainted 
+end
+
+
+
diff --git a/test/mergestate/tainted.xh b/test/mergestate/tainted.xh
new file mode 100644 (file)
index 0000000..0c95a90
--- /dev/null
@@ -0,0 +1,5 @@
+/*
+** tainted.xh
+*/
+
+# include "taintednm.xh"
diff --git a/test/mergestate/taintednm.c b/test/mergestate/taintednm.c
new file mode 100644 (file)
index 0000000..8e163d0
--- /dev/null
@@ -0,0 +1,25 @@
+char *f (/*@tainted@*/ char *s)
+{
+  char t[50];
+  char t2[20];
+
+  (void) system ("test"); 
+  strcpy (t, "test");
+  strcpy (t2, "okay");
+
+  (void) system (t);
+
+  t = strcat3 (t, t2, t2);
+  (void) system (t); /* okay */
+
+  t = strcat3 (t, t2, s);
+  (void) system (t); /* error */
+
+  t = strcat3 (t, t2, t2);
+  (void) system (t); /* error */
+
+  t = strcpy (t, s);
+  (void) system (t); /* error */
+
+  return t; /* error - tainted, stack-allocated */
+}
diff --git a/test/mergestate/taintednm.mts b/test/mergestate/taintednm.mts
new file mode 100644 (file)
index 0000000..1dd26b2
--- /dev/null
@@ -0,0 +1,22 @@
+attribute taintedness
+   context reference char *
+   oneof untainted, tainted
+   annotations
+      tainted reference ==> tainted
+      untainted reference ==> untainted
+   transfers
+      tainted as untainted ==> error "Possibly tainted storage used as untainted."
+      untainted as tainted ==> untainted
+   merge
+      tainted + untainted ==> tainted
+      untainted + tainted ==> error "bogus merge"
+   defaults 
+      reference ==> tainted
+      parameter ==> tainted
+      result ==> tainted
+      literal ==> untainted
+      null ==> untainted 
+end
+
+
+
diff --git a/test/mergestate/taintednm.xh b/test/mergestate/taintednm.xh
new file mode 100644 (file)
index 0000000..e8e7a4b
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+** tainted.xh
+*/
+
+/* Library functions annotated for tainted.mts */
+
+extern int remove (/*@untainted@*/ char *filename) /*@modifies fileSystem, errno@*/ ;
+extern int rename (/*@untainted@*/ char *old, /*@untainted@*/ char *new) ;
+
+extern /*@observer@*/ char *tmpnam (/*@untainted@*/ char *s) ;
+
+extern FILE *fopen (/*@untainted@*/ char *filename, char *mode) ;
+
+extern int printf (/*@untainted@*/ char *format, ...) ;
+
+extern /*@null@*/ FILE *freopen (/*@untainted@*/ char *filename, char *mode, FILE *stream) ;
+
+extern /*@null@*/ /*@tainted@*/ char *
+  fgets (/*@returned@*/ /*@out@*/ char *s, int n, FILE *stream) 
+  /*@ensures tainted s@*/ 
+  /*@modifies *s@*/ ;
+
+extern int system (/*@untainted@*/ /*@null@*/ char *s) /*@modifies fileSystem@*/ ;
+
+extern char *strcpy (/*@returned@*/ char *s1, char *s2) 
+  /*@ensures s1:taintedness = s2:taintedness@*/ ;
+
+extern char *strcat (/*@returned@*/ char *s1, char *s2) 
+  /*@ensures s1:taintedness = s1:taintedness | s2:taintedness@*/ 
+  /*@ensures result:taintedness = s1:taintedness | s2:taintedness @*/ ;
+
+extern char *strcat3 (/*@returned@*/ char *s1, char *s2, char *s3) 
+  /*@ensures s1:taintedness = s1:taintedness | s2:taintedness | s3:taintedness@*/ 
+  /*@ensures result:taintedness = s1:taintedness | s2:taintedness | s3:taintedness @*/ ;
+
index df6c78a3510f4ba6520b2cef7d570c2d517e0469..a98b3185ea8b44b2d55457661e879cd06c9d8498 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index f16ee43d68bcd0e8737429efbeb2e603cbbd90b3..c800e6de60dbca0a1176315876bf00c2370b0222 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index ae7deb36d28aa86ce2a148b0e1e8b972123aa6a5..5993039bcee6fa405d42fa53ae2fc3b6d5318c07 100644 (file)
@@ -1,4 +1,4 @@
-/* Output from LCLint 3.0.0.13 */
+/* Output from LCLint 3.0.0.16 */
 # include "bool.h"
 
 
index 5fe1366f5340b30b7a89171d092212466f7ab860..6df29e1c2377ed118b93fa25b9bf560afd5fbcde 100644 (file)
@@ -1,5 +1,5 @@
 ;;LCLint Dump: null6.lcd
-;;LCLint 3.0.0.13 --- 27 August 2001
+;;LCLint 3.0.0.16 --- 10 September 2001
 ;;lib:168
 ;;ctTable
 0 u-2 19 38
index 7eff7843e57484c1710d6e84e84e0e986ecaf747..73a1ff83e46a27d0d8075884cd43a71206edc502 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index 312824cbfc039e9a14719372c0a492d812df2d0a..3be672cb401b50b26828b551f98733ee60ace38c 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index 6e26eded948719cae8657543e52f889e7651b0cc..193c76f43e0e3498f76471980628b4e4b1493079 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index de15b34786d06904aa5f02a081f9be83b7e79cc6..a54609d08077c76a0d0252f11811d561ae0f3d2f 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index 0c909770139f3639c29d6e0122377d5745484098..2d4d5cd21516f292a039f7b99c30823f2407b81b 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
diff --git a/test/postnotnull.c b/test/postnotnull.c
new file mode 100644 (file)
index 0000000..b49f029
--- /dev/null
@@ -0,0 +1,20 @@
+typedef struct {
+  char *x;
+} T;
+
+static void foo(/*@special@*/ T* x)
+     /*@defines x->x@*/
+     /*@post:notnull x->x@*/ ;
+     
+static void bar(/*@special@*/ T* x)
+     /*@post:notnull x->x@*/
+{
+  foo(x);
+}
+
+void test()
+{
+  T a;
+  foo(&a);
+  bar(&a);
+}
diff --git a/test/postnotnull.expect b/test/postnotnull.expect
new file mode 100644 (file)
index 0000000..0da4ee0
--- /dev/null
@@ -0,0 +1,6 @@
+
+postnotnull.c: (in function test)
+postnotnull.c:20:2: Only storage a.x (type char *) derived from variable
+                       declared in this scope is not released (memory leak)
+
+Finished LCLint checking --- 1 code error found, as expected
index e1069a701c66d4a563d2edd0e143cd4abcb4a784..51b4d446c8573ea5b0f2f526f3bfba795ed2233f 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index 32678364978b21ac2609e375cb2719d74e0de42b..0cd8913d15ffd7b37338163a9c1044b11d2fe659 100644 (file)
@@ -1,4 +1,4 @@
-/* Output from LCLint 3.0.0.13 */
+/* Output from LCLint 3.0.0.16 */
 # include "bool.h"
 
 
index e673b359a024f24bcc252fc5c8587b93683cb88b..ea7185f490d9b9e3eef0cdf416dad7586ce675d0 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index c8156ea648a73790b1085971b532711d0382f2df..13bd14cc58b06e012b62c75452a2bdcd0f298f4b 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index c19ed3a90e9940d5afb5429c781578a6fbba42c1..7342a92a3e8f696771296404306b32dc948b01f1 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index d596d4ed0120cde920726dc9d98a612db967f54e..b7499b79221b77e390708ebd48a3832e081703e4 100644 (file)
@@ -1,5 +1,5 @@
 ;;LCLint Dump: newlint.lcd
-;;LCLint 3.0.0.13 --- 27 August 2001
+;;LCLint 3.0.0.16 --- 10 September 2001
 ;;lib:168
 ;;ctTable
 0 u-2 19 38
index c29a12f84fda6e9eca095f15180240f810345b13..a36e194b29d57030685eed3753aeae982e2ae281 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
index 8bfc84d24afb4c9af907e9b6c4ba8214d9c68905..271bd8ed0b0d1e5fee99545a43a0029ae7ab0626 100644 (file)
@@ -1,4 +1,4 @@
-%PASSED Output from LCLint 3.0.0.13
+%PASSED Output from LCLint 3.0.0.16
 %LCLimports 
 %LCLSortTable
 %LCLsort bool immutable nil nil
diff --git a/test/unsignedcompare.c b/test/unsignedcompare.c
new file mode 100644 (file)
index 0000000..056f363
--- /dev/null
@@ -0,0 +1,16 @@
+void test (int fd, void *buffer, size_t cnt)
+{
+  unsigned long res;
+
+  res = read(fd, buffer, cnt);
+
+  if (res <= 0)
+    {
+      printf ("You lose!");
+    }
+
+  if (res < 0 || res >= 0)
+    {
+      printf ("twice loser");
+    }
+}
diff --git a/test/unsignedcompare.expect b/test/unsignedcompare.expect
new file mode 100644 (file)
index 0000000..5db7a80
--- /dev/null
@@ -0,0 +1,14 @@
+lclint +posixlib unsignedcompare.c -expect 2
+
+unsignedcompare.c: (in function test)
+unsignedcompare.c:5:3: Assignment of ssize_t to unsigned long int:
+                          res = read(fd, buffer, cnt)
+  To allow arbitrary integral types to match long unsigned, use
+  +longunsignedintegral.
+unsignedcompare.c:7:7: Comparison of unsigned value involving zero: res <= 0
+  An unsigned value is used in a comparison with zero in a way that is either a
+  bug or confusing. (-unsignedcompare will suppress message)
+unsignedcompare.c:12:7: Comparison of unsigned value involving zero: res < 0
+unsignedcompare.c:12:18: Comparison of unsigned value involving zero: res >= 0
+
+Finished LCLint checking --- 4 code errors found, expected 2
This page took 0.293556 seconds and 5 git commands to generate.