]> andersk Git - splint.git/blobdiff - test/manual.expect
Added test cases from the buffer checking chapter of the manual.
[splint.git] / test / manual.expect
index 99f9ad24b5a005fba3b99dd9f03652eb53829079..1c0a98608b796a658d95e5c27e03e54a57269cf4 100644 (file)
@@ -198,3 +198,36 @@ Finished checking --- 1 code warning, as expected
 ignore.c:10: Return value (type bool) ignored: fb()
 
 Finished checking --- 1 code warning, as expected
+
+setChar.c:5: Possible out-of-bounds store:
+    buf[10]
+    Unable to resolve constraint:
+    requires 9 >= 10
+     needed to satisfy precondition:
+    requires maxSet(buf @ setChar.c:5) >= 10
+
+Finished checking --- 1 code warning, as expected
+
+multiError.c:4: Possible out-of-bounds store:
+    buf[2]
+    Unable to resolve constraint:
+    requires maxSet(buf @ multiError.c:4) >= 2
+     needed to satisfy precondition:
+    requires maxSet(buf @ multiError.c:4) >= 2
+
+Finished checking --- 1 code warning, as expected
+
+updateMyEnv.c:16: Possible out-of-bounds store:
+    strcpy(str, tmp)
+    Unable to resolve constraint:
+    requires maxSet(str @ updateMyEnv.c:16) >=
+    maxRead(getenv("MYENV") @ updateMyEnv.c:14)
+     needed to satisfy precondition:
+    requires maxSet(str @ updateMyEnv.c:16) >=
+    maxRead(tmp @ updateMyEnv.c:16)
+     derived from strcpy precondition: requires
+    maxSet(<parameter 1>) >= maxRead(<parameter 2>)
+
+Finished checking --- 1 code warning, as expected
+
+Finished checking --- no warnings
This page took 0.191147 seconds and 4 git commands to generate.