Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upC99 for-loop defined variable gets incorrect scope #211
Comments
added a commit
that referenced
this issue
Dec 12, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
|
Should be fixed by 6753e8f |
bschommer
closed this
Dec 12, 2017
added a commit
that referenced
this issue
Jan 13, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
MarcelAtSolidSands commentedDec 11, 2017
We found a run-time error with SuperTest for the program below. The program should print 100 for the value of 'press', but when compiled with CompCert 3.1 on an x86 Apple Mac, it prints 3. It looks like CompCert is confused about the scopes of the two variables called 'press'.
===========================================
#include <stdio.h>
int press = 100;
int valve = 0;
int main (void) {
for (int press = 0; press < 3; press++) {
valve++;
}
printf ("Value of 'press' should be 100, is: %d\n", press);
return valve - 3;
}