]> andersk Git - splint.git/blobdiff - test/numabstract.c
Improved tracking of state change locations. Added +showdeephistory
[splint.git] / test / numabstract.c
index be3a00874c1ff3ebd04952d8b84342c2b563f18c..1345a2f13c32931b5084492f929d8dc15743a534 100644 (file)
@@ -9,10 +9,10 @@ int adding (apples a, oranges o)
   int i;
   apples a2;
   a++; /* Okay */
-  a2 = 13; /* error (unless -numabstractlit) ? */
+  a2 = 13; /* error (unless +numabstractlit) ? */
   a2 = 'a'; /* error */
   i = 'c'; /* error */
-  a2 = (apples) 13; /* unless +numabstractcast */
+  a2 = (apples) 13; /* warning if +numabstractcast */
   a2 = a + 5; /* okay */
   a2 = o; /* error */
   a2 = a2 - a; /* okay */
@@ -20,3 +20,30 @@ int adding (apples a, oranges o)
   i = a2 + a; /* error */
   return a + o; /* error */
 }
+
+int comparing (apples a, oranges o, apples a2)
+{
+  if (a < 3) { /* error unless +numabstractlit */
+    return 3;
+  } 
+
+  if (a < o) { /* error */
+    return 5;
+  }
+
+  if (a == o) { /* error */
+    return 6;
+  }
+
+  if (a == a2) { /* okay */
+    return 23;
+  }
+
+  --a2;
+
+  if (a >= a2) { 
+    return 523;
+  }
+
+  return 7;
+}
This page took 0.056022 seconds and 4 git commands to generate.