]> andersk Git - splint.git/blobdiff - src/usymtab.c
Updated copyright date.
[splint.git] / src / usymtab.c
index 967606ed82bcd157bd862f3dbb650236580043fc..278fbb9e41a325c82bdeab85bf7dcbaf5b5f2e62 100644 (file)
@@ -1,6 +1,6 @@
 /*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2001 University of Virginia,
+** Splint - annotation-assisted static program checker
+** Copyright (C) 1994-2002 University of Virginia,
 **         Massachusetts Institute of Technology
 **
 ** This program is free software; you can redistribute it and/or modify it
@@ -19,7 +19,7 @@
 **
 ** For information on lclint: lclint-request@cs.virginia.edu
 ** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
+** For more information: http://www.splint.org
 */
 /*
 ** usymtab
@@ -112,10 +112,15 @@ static bool usymtab_isDefinitelyNullAux (sRef p_s) /*@globals utab@*/ ;
 static /*@only@*/ cstring usymtab_unparseStackTab (usymtab p_t);
 static /*@exposed@*/ /*@dependent@*/ uentry 
   usymtab_getRefTab (/*@notnull@*/ usymtab p_u, int p_level, usymId p_index);
+
+# ifdef __LCLINT__
+/* These are not used anymore... */
 static /*@unused@*/ /*@only@*/ cstring 
   usymtab_unparseLocalAux (/*@notnull@*/ usymtab p_s);
 static /*@unused@*/ /*@only@*/ cstring 
   usymtab_unparseLocalList (/*@notnull@*/ usymtab p_s);
+# endif
+
 static /*@only@*/ cstring usymtab_typeName (/*@notnull@*/ usymtab p_t);
 static void usymtab_handleParams (void)
    /*@globals utab, globtab, filetab@*/ 
@@ -853,13 +858,21 @@ usymtab_supEntryAux (/*@notnull@*/ usymtab st,
 
              if (uentry_isDeclared (ce))
                {
-                 llassert ((st->lexlevel > fileScope || !sRef_modInFunction ()));
+                 /* evans 2001-08-26
+                   No - this can happen for internal typedefs
+                   llassert ((st->lexlevel > fileScope || !sRef_modInFunction ()));
+                 */
+
                  DPRINTF (("Merge defn"));
                  uentry_mergeDefinition (ce, e);
                }
              else 
                {
-                 llassert ((st->lexlevel > fileScope || !sRef_modInFunction ()));
+                 /* evans 2001-08-26
+                   No - this can happen for internal typedefs
+                   llassert ((st->lexlevel > fileScope || !sRef_modInFunction ()));
+                 */
+
                  DPRINTF (("Merge entries..."));
                  uentry_mergeEntries (ce, e);
                  DPRINTF (("After: %s", uentry_unparseFull (ce)));
@@ -1566,6 +1579,7 @@ usymtab_getTypeEntryName (usymId uid)
   return (uentry_getName (ue));
 }
 
+# if 0
 /*@unused@*/ static void
 usymtab_rehash (/*@notnull@*/ usymtab s)
 {
@@ -1583,6 +1597,7 @@ usymtab_rehash (/*@notnull@*/ usymtab s)
       cstringTable_insert (s->htable, cstring_copy (uentry_rawName (s->entries[i])), i);
     }
 }
+# endif
 
 /*
 ** superficial copy of usymtab
@@ -4178,7 +4193,7 @@ void usymtab_checkFinalScope (bool isReturn)
                                        {
                                          ss (sr);
                                        }
-
+                                     
                                      DPRINTF (("Storage: %s", sRef_unparseFull (sr)));
                                    }  
                                }
@@ -4445,8 +4460,8 @@ void usymtab_exitScope (exprNode expr)
       /*@i@*/ lctab->env = utab;  
       /*@i@*/ utab = ctab;
     /*@-branchstate@*/ } /*@=branchstate@*/
-/*@-globstate@*/
-}
+  /*@-globstate@*/
+/*@i523@*/ }
 /*@=globstate@*/
 
 /*
@@ -5380,6 +5395,10 @@ static bool usymtab_isGuardedAux (sRef s)
   
   while (tab->lexlevel >= lowlevel)
     {
+      DPRINTF (("Is guarded? [%s] %s", 
+               guardSet_unparse (tab->guards),
+               sRef_unparseFull (s)));
+
       if (guardSet_isGuarded (tab->guards, s))
        {
          /*
@@ -5423,7 +5442,7 @@ void usymtab_unguard (sRef s) /*@modifies utab@*/
 
 bool usymtab_isGuarded (sRef s)
 {
-  
+  DPRINTF (("Is guarded? %s", sRef_unparseFull (s)));
   return (sRef_aliasCompleteSimplePred (usymtab_isGuardedAux, s));
 }
 
@@ -5845,6 +5864,7 @@ usymtab_printComplete ()
   mstring_free (ind);
 }
 
+# ifdef __LCLINT__
 static /*@only@*/ cstring /*@unused@*/ 
 usymtab_unparseLocalAux (/*@notnull@*/ usymtab s)
 {
@@ -5860,7 +5880,6 @@ usymtab_unparseLocalAux (/*@notnull@*/ usymtab s)
   return (c);
 }
 
-# if 0
 static cstring /*@unused@*/ /*@only@*/ 
 usymtab_unparseLocalList (/*@notnull@*/ usymtab s)
 {
This page took 0.042581 seconds and 4 git commands to generate.