source:
CIVL/mods/dev.civl.com/examples/contracts/contractsSeq/pointers4.c@
cb4d4f4
| Last change on this file since cb4d4f4 was aad342c, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 340 bytes | |
| Line | |
|---|---|
| 1 | #include <assert.h> |
| 2 | |
| 3 | /*@ requires \valid(x + (0 .. 3)); |
| 4 | |
| 5 | @ requires \valid(x[0] + (0 .. 3)); |
| 6 | @ requires \valid(x[1] + (0 .. 3)); |
| 7 | @ requires \valid(x[2] + (0 .. 3)); |
| 8 | */ |
| 9 | int add(int ** x) |
| 10 | { |
| 11 | int * y = x[0]+1; |
| 12 | |
| 13 | x[0][0] = 9; |
| 14 | x[0][1] = 8; |
| 15 | assert(x[0][0] - x[0][1] == 1); |
| 16 | return 0; |
| 17 | } |
| 18 | |
| 19 | |
| 20 | int main() { |
| 21 | add((void*)0); |
| 22 | return 0; |
| 23 | } |
Note:
See TracBrowser
for help on using the repository browser.
