]> andersk Git - splint.git/blobdiff - src/constraint.c
Added splint.spec file contributed by Heiko Abraham
[splint.git] / src / constraint.c
index 24596df56a1ef4810d35ba78871df9fce4b2f97f..cb87d1025e6e0550d5eb06a81a7f2c6e60df90bf 100644 (file)
 
 /*@i33*/
 
-/*@access exprNode @*/
-
+/*@access exprNode@*/ /* !!! NO! Don't do this recklessly! */
+/*@-nullderef@*/ /* !!! DRL needs to fix this code! */
+/*@-nullstate@*/ /* !!! DRL needs to fix this code! */
+/*@-temptrans@*/ /* !!! DRL needs to fix this code! */
 
 static /*@only@*/ cstring  constraint_printDetailedPostCondition (/*@observer@*/ /*@temp@*/ constraint p_c);
 
@@ -119,14 +121,20 @@ constraint makeConstraintParse3 (constraintExpr l, lltok relOp, constraintExpr r
     
   ret->lexpr = constraintExpr_copy (l);
 
-  if (relOp.tok == GE_OP)
+  if (lltok_getTok (relOp) == GE_OP)
+    {
       ret->ar = GTE;
-  else if (relOp.tok == LE_OP)
-    ret->ar = LTE;
-  else if (relOp.tok == EQ_OP)
-    ret->ar = EQ;
+    }
+  else if (lltok_getTok (relOp) == LE_OP)
+    {
+      ret->ar = LTE;
+    }
+  else if (lltok_getTok (relOp) == EQ_OP)
+    {
+      ret->ar = EQ;
+    }
   else
-  llfatalbug ( message ("Unsupported relational operator"));
+    llfatalbug ( message ("Unsupported relational operator"));
 
   ret->expr = constraintExpr_copy (r);
 
@@ -314,7 +322,7 @@ bool constraint_hasMaxSet (constraint c)
   return FALSE;
 }
 
-constraint constraint_makeReadSafeExprNode (  exprNode po, exprNode ind)
+constraint constraint_makeReadSafeExprNode (exprNode po, exprNode ind)
 {
   constraint ret = constraint_makeNew ();
 
@@ -666,6 +674,12 @@ void constraint_printErrorPostCondition (constraint c, fileloc loc)
 
   temp = constraint_getFileloc (c);
 
+    
+  if (context_getFlag (FLG_BOUNDSCOMPACTERRORMESSAGES ) )
+    {
+      string = cstring_replaceChar(string, '\n', ' ');
+    }
+  
   if (fileloc_isDefined (temp))
     {
       errorLoc = temp;
@@ -727,7 +741,14 @@ void constraint_printError (constraint c, fileloc loc)
       fileloc_free (temp);
       errorLoc = fileloc_copy (errorLoc);
     }
-      
+
+  
+  if (context_getFlag (FLG_BOUNDSCOMPACTERRORMESSAGES ) )
+    {
+      string = cstring_replaceChar(string, '\n', ' ');
+    }
+
+
   if (c->post)
     {
       voptgenerror (FLG_FUNCTIONPOST, string, errorLoc);
@@ -814,7 +835,7 @@ cstring  constraint_printDetailed (constraint c)
 {
   cstring st = cstring_undefined;
   cstring temp = cstring_undefined;
-    cstring genExpr;
+  cstring genExpr;
   
   if (!c->post)
     {
This page took 0.080908 seconds and 4 git commands to generate.