[fpc-pascal] Using for-loop index variable after loop

Jonas Maebe jonas.maebe at elis.ugent.be
Mon Oct 10 12:35:53 CEST 2016


Juha Manninen wrote on Mon, 10 Oct 2016:

> I have always avoided using a for-loop index variable after the loop.
> I thought its value can be unpredictable in some situations when the
> compiler reuses its register or memory etc.

That is correct.

> The compiler, FPC 3.0, does not warn about it.

Indeed: http://bugs.freepascal.org/view.php?id=12508


Jonas



More information about the fpc-pascal mailing list