[fpc-pascal] FPC allows modifying loop variable

Jonas Maebe jonas.maebe at elis.ugent.be
Fri Jul 22 15:04:59 CEST 2016


On 22/07/16 14:49, Graeme Geldenhuys wrote:
> I just discovered a surprising bug in my application. I had a variable
> "b" defined which I used in a FOR loop. FPC forbids you to modify that
> loop variable inside the for loop - which is understandable.
>
> However, the loop called a local procedure, and that local procedure
> modified the loop variable. FPC never complained about it. Is this a FPC
> bug?

FPC has no interprocedural dataflow analysis that could catch something 
like that.


Jonas



More information about the fpc-pascal mailing list