With struct containing arrays, option -unspecified-access is too strict
ID0002152: This issue was created automatically from Mantis Issue 2152. Further discussion may take place here.
Id | Project | Category | View | Due Date | Updated |
---|---|---|---|---|---|
ID0002152 | Frama-C | Kernel | public | 2015-08-21 | 2015-08-21 |
Reporter | pascal | Assigned To | virgile | Resolution | open |
Priority | normal | Severity | minor | Reproducibility | always |
Platform | - | OS | - | OS Version | - |
Product Version | - | Target Version | - | Fixed in Version | - |
Description :
The program given below is correct, but:
$ frama-c -val t.c -unspecified-access ... t.c:4:[kernel] warning: Unspecified sequence with side effect: /* s.t[1] <- s.t / s.t[1] = (char)0; / s.t[2] <- s.t */ s.t[2] = s.t[1]; [value] Analyzing a complete application starting at main ... t.c:4:[kernel] warning: undefined multiple accesses in expression. assert \separated(&s.t[1], &s.t); [value] Recording results for main [value] done for function main t.c:4:[value] Assertion 'Value,separation' got final status invalid. ...
I expected this program would be accepted without a warning about multiple accesses in expressions.
Additional Information :
The struct is necessary for the bug to appear. With a toplevel array t, the assignment t[2] = t[1] = 0; does not cause a warning.
Steps To Reproduce :
struct s { char t[3]; } s;
int main() {
s.t[2] = s.t[1] = 0;
return 0;
}