FAQ
Cover
\
Build
\
Source
\
Bugs
\
Reference
\
Libraries
\
Tools
The bugs database has moved
here
.
Bug 420 : Unexpected parsing, semicolon after a for()
Last modified: 2006-10-16 18:55
P
roject:
processing
trash
Version:
unspecified
Co
m
ponent:
android
book
core
libraries
pde
reference
tools
web
Status:
RESOLVED
Resolution:
INVALID -
Pr
i
ority:
P2
Severity:
normal
Platform
All
O
S:
All
Windows
Mac OS
Linux
Other
Reporter:
REAS
Assigned To:
fry
Attachment
Type
Created
Size
Actions
Description
: Opened: 2006-10-16 11:04
The following code:
int i;
for (i=0; i<400; i=i+4); {
println(i);
}
Prints "400" to the console. The ";" at the end of the for() is having a
strange effect. No error is reported.
Additional Comment
#1 From fry 2006-10-16 18:55
that's perfectly legal syntax but nasty. it's like doing:
while (waitingForSomething) { }
and this would be the same:
while (waitingForSomething) ;
and it works identically with for(). this is something that we might
consider to explicitly disallow in the future. then again, with better
warnings, a compiler should warn you about this sort of thing (i.e. eclipse
does).