Legal C99 file-scope const misparsed
description
/* Today I ran into a bug which is hopefully not grave, but worth being mentioned. */
include <vcc.h>
const int i; /* References are given with respect to the C99 standard. The variable i has external linkage by 6.2.2, para 5, static storage duration by 6.2.4, para 3. Its initial value is 0 by 6.7.8, para 10. */
int main(void) {
_(assert i==0);
return 0;
}
/* The file contains a legal C99 code. Output of vcc /3:
OOPS: error in expr
Exiting with 3 (1 error(s).)
Notice that the location of the error is missing, which is a headache if the file is large.
*/
/* vcc /version returns:
Microsoft Research Vcc Version 2.1.40523.0
Microsoft Research Boogie Version 2.1.30503.0
Microsoft Research Z3 Version 2.0.41203.1
*/