Open sabrina-reis opened 11 months ago
Thanks for your report.
The issue with NUMBUCKETS is known and might indeed deserve to be reported explicitly in the ACSL manual. Basically, the C preprocessor must treat 0..NUMBUCKETS
as a preprocessing number token, as per Section 6.4.8 of the C standard (C11 and C17, but if I'm not mistaken C99 has the same clause), so that it won't see NUMBUCKETS
as a separate token.
On the other hand, I don't have any issue with \valid(buckets+(0..1))
, at least on a very quick check. Which version of Frama-C are you using? Could you provide a complete example reproducing the problem?
Thanks for your response, Virgile. I couldn't reproduce the issue with the int literals this morning. I'll edit my report to make clear this is just a problem with global variables. I appreciate your clarification on the origin of this problem and hope that this report helps develop more thorough documentation for ACSL.
I wanted to bring this behavior of the ACSL parser to other people's attention. On the whole, whitespace is not an issue for the ACSL parser, so I did not anticipate this issue and I did not see it mentioned in the manual or on the web.
Let's say I have the following C code:
When I run frama-c on this code with -wp, I get the following error:
The issue disappears when I put a space after
..
like so:The ACSL manual should probably bring attention to the fact that whitespace is needed for parsing here if you're using a global variable.