]> andersk Git - splint.git/blobdiff - src/clabstract.c
Fixed problem with loop guards in loop test effects. New test case
[splint.git] / src / clabstract.c
index 8f2fa20e2574a04508d9c6f39e3c3c0b7fb15998..10dbd041058d2c21b04b03bddd51202c350a8186 100644 (file)
@@ -17,8 +17,8 @@
 ** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
 ** MA 02111-1307, USA.
 **
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
+** For information on splint: info@splint.org
+** To report a bug: splint-bug@splint.org
 ** For more information: http://www.splint.org
 */
 /*
@@ -28,7 +28,7 @@
 **
 */
 
-# include "lclintMacros.nf"
+# include "splintMacros.nf"
 # include "llbasic.h"
 # include "cgrammar.h"
 
@@ -1077,7 +1077,7 @@ fixUentryList (idDeclList tl, qtype q)
 ** Microsoft VC++.  It is not supported by the ANSI standard.  
 **
 ** The inner fields are added to the outer structure.  This is meaningful
-** for nesting structs inside unions, but lclint does no related 
+** for nesting structs inside unions, but Splint does no related 
 ** checking.
 */
 
@@ -1092,6 +1092,11 @@ fixUnnamedDecl (qtype q)
 
       return (uentryList_copy (res));
     }
+  else if (ctype_isEnum (ct))
+    {
+      /* evans 2002-02-05: nothing to do for unnamed enum lists */
+      return uentryList_undefined;
+    }
   else
     {      
       BADBRANCHCONT;
@@ -1250,8 +1255,13 @@ void clabstract_declareType (/*@only@*/ exprNodeList decls, /*@only@*/ warnClaus
 {
   llassert (ProcessingTypedef);
 
+  DPRINTF (("Declare type: %s", exprNodeList_unparse (decls)));
+
   if (warnClause_isDefined (warn))
     {
+      DPRINTF (("Has a warn clause!"));
+      DPRINTF (("Warn: %s", warnClause_unparse (warn)));
+
       exprNodeList_elements (decls, el)
        {
          uentry ue = exprNode_getUentry (el);
@@ -1272,6 +1282,7 @@ void clabstract_declareType (/*@only@*/ exprNodeList decls, /*@only@*/ warnClaus
                    uentry_unparse (ue), warnClause_unparse (warn)));
 
          uentry_addWarning (ue, warnClause_copy (warn));
+         DPRINTF (("After add warning: %s", uentry_unparseFull (ue)));
          cstring_free (uname);
        } end_exprNodeList_elements;
     }
@@ -2069,11 +2080,11 @@ sRef checkStateClausesId (uentry ue)
     {
       voptgenerror 
        (FLG_COMMENTERROR,
-        message ("Global variable %s used special clause.  (Global variables "
-                 "are not recognized in special clauses.  If there is "
+        message ("Global variable %s used state clause.  (Global variables "
+                 "are not recognized in state clauses.  If there is "
                  "sufficient interest in support for this, it may be "
                  "added to a future release.  Send mail to "
-                 "lclint@cs.virginia.edu.)",
+                 "info@splint.org.)",
                  s),
         g_currentloc);
       
@@ -2194,7 +2205,7 @@ void checkModifiesId (uentry ue)
        }
       else
        {
-         fileloc loc = fileloc_decColumn (g_currentloc, cstring_length (s));
+         fileloc loc = fileloc_decColumn (g_currentloc, size_toInt (cstring_length (s)));
          ret = sRef_undefined;
 
          voptgenerror 
@@ -2251,7 +2262,7 @@ sRef fixStateClausesId (cstring s)
                          "are not recognized in function clauses.  If there is "
                          "sufficient interest in support for this, it may be "
                          "added to a future release.  Send mail to "
-                         "lclint@cs.virginia.edu.)",
+                         "info@splint.org.)",
                          s), 
                 g_currentloc);
              
@@ -2260,9 +2271,41 @@ sRef fixStateClausesId (cstring s)
        }
       else
        {
-         fileloc loc = fileloc_decColumn (g_currentloc, cstring_length (s));
+         /*@i222@*/
+         /*drl handle structure invariant */
+
+         /*@i222@*/
+         /*check that we're in a structure */
+# if 0\r
+                 /*@unused@*/    uentryList ueL;
+         /*@unused@*/ uentry ue2;
+         /*@unused@*/ ctype ct;\r
+# endif
+         fileloc loc = fileloc_decColumn (g_currentloc, size_toInt (cstring_length (s)));
          ret = sRef_undefined; 
-         
+# if 0
+         /*drl commenting this out for now 
+         ct = context_getLastStruct ( ct );
+
+         llassert( ctype_isStruct(ct) );
+
+         ueL =  ctype_getFields (ct);
+
+         ue2 = uentryList_lookupField (ueL, s);
+
+         if (!uentry_isUndefined(ue2) )
+           {
+             ret = uentry_getSref(ue2);
+             
+             DPRINTF((
+                      message("Got field in structure in the annotation constraint: %s (or sref: %s)", s, sRef_unparse(ret) )
+                      ));
+             
+             return ret;
+           }
+         */\r
+# endif\r
+
          voptgenerror 
            (FLG_UNRECOG, 
             message ("Unrecognized identifier in function clause: %s", s), 
This page took 0.05286 seconds and 4 git commands to generate.