Closed jerryGitHub closed 11 years ago
Does the Atmel Studio compiler command line have -std=gnu99 or -std=c99?
AFAIK, the scope restriction of the loop variable is a C99 feature. The released version of Naggy doesn't turn on C99 mode even if the Atmel Studio compiler settings does, but that's been fixed (see issue #6) and should work in the next release of Naggy.
You're right, the scope limitation seems to be a C99 feature. The standard setting in the Gnu-cc is -std=gnu99. If I remove this, then the same error as in Naggy appears. I'd looked up the scope in the New Testament, but it wasn't very clear to me on this point. Thanks for your quick reply, and for a very useful tool
If you have the following program:
int main(void) { int sum = 0;
} Naggy complains that i has been redefined, the Atmel Studio 6.1 compiler doesn't indicate an error. The scope of the variable i is confined to the loop, the name is invisible after the end of the first loop.