name lookup of 'i' changed for new ISO 'for' scoping

dc42:

majenko:

Any decent C++ compiler will warn about that stray semicolon, but unfortunately the Arduino IDE turns most of the gcc compiler warnings off.

Why? That's a perfectly valid thing to do, and I do it often. Especially when traversing to the end of a linked list:

for(ptr=head; ptr->next; ptr=ptr->next);

ptr->next = newelement;

Yes, it's valid C++, but convention is that if you really want to write a loop with an empty body, you indicate that it is intentional, either by using { }, or by putting a newline or a comment between the ) and the ; .

Yes, but strip the newlines and the comments, which is generally what the compiler does, and how can it tell the difference? It can't - so no warnings. Neither I, nor the compiler, care what different people do as "convention" - you can't have a warning for something that is perfectly valid, just not correct.