source:
CIVL/mods/dev.civl.com/examples/contracts/contractsSeq/voidPointers.c@
cb4d4f4
| Last change on this file since cb4d4f4 was aad342c, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 207 bytes | |
| Rev | Line | |
|---|---|---|
| [9aaed1f] | 1 | /*@ requires \valid(x + (0 .. 2)); |
| 2 | @ ensures \valid(x + (0 .. 2)); | |
| 3 | @*/ | |
| 4 | int incr(void * x) | |
| 5 | { | |
| 6 | int * y; | |
| 7 | int ret; | |
| 8 | ||
| 9 | y = (int*)x; | |
| 10 | return (y[0] + 1); | |
| 11 | } | |
| 12 | ||
| 13 | int main() { | |
| 14 | incr((void *)-1); | |
| 15 | return 0; | |
| 16 | } |
Note:
See TracBrowser
for help on using the repository browser.
