FOR() loops are fine, use which ever you prefer.
My guess is that the compiler is giving good information about a problem with the for() arguments but that this information is not being passed through in the IDE. We are working on simplifying the interface between the IDE and compiler so that more information will stream through. Full compiler information in the IDE is definitely the expected and correct behavior.
In the short term pulling out the declarations of 'int i' and 'int len' like gbulmer recommends but still using a for loop might help find the problem. C++ allows initialization of variables in the for() parameters but C does not; the sketch is C++ so this shouldn't be a problem but it's worth checking.