I have a question regarding using Eva for functions that return pointers, I am using Frama-C version 23.1 (Vanadium). The issue arises when only the prototype, and not the body, of the function is available, and the assumption is that the function should return a pointer to the beginning of an array. Below is a minimal example:
int arr[8];
int x,y;
int *foo();
// int *foo() {
// return arr;
// }
void main() {
int *a = foo();
x = a[2];
y = 3;
}
The analysis stops upon reaching the line x = a[2] and generates the following alarm from the associated memory assertion:
alarm: assert Eva: mem_access: \valid_read(a + 2);
Status: **NOT** VALID according to Eva (under hypotheses)
This instruction always fail.
If I provide the body of the function (which is commented out in the example), the analysis works. However, I wonder if there is some way to fully analyze this program using Eva, without providing the body, for example by annotating the foo prototype in ACSL. I tried using the allocation clause of ACSL function contracts, but it seems not supported by Eva. Perhaps there is some other annotation that I have not found or some other way of configuring Eva to allow analysis of this program?
Any help would be greatly appreciated.