[fpc-devel] Declare variables inside the code
Hans-Peter Diettrich
DrDiettrich1 at aol.com
Wed May 11 13:03:23 CEST 2011
Joerg Schuelke schrieb:
> Ok, not the reason. But coding security is the reason, you should do
> so, if you can. Look at Stroustrup. The reason for pascal not to do so,
> is what follows from that, a really complicated stack unwinding, for
> example.
Stack unwinding is not an argument, IMO. C++ and OPL have managed data
types, that require proper stack unwinding. But there is no requirement
that stack unwinding has to recurse down into local code blocks, since
the compiler is free to collect all managed variables into one memory block.
The use of local variables at block level has other consequences:
+ every loop could use "i" for the loop variable
- the user (or IDE) has to figure out the declaration of every "i"
DoDi
More information about the fpc-devel
mailing list