Regis Cridlig wrote:
If you take a closer look at the Pascal source code below there is no need for a trampoline or stub code since the inner function E does not use any variable or parameter in the lexical scope of the containing function Q.
Hence, why does gpc generate a trampoline in this case? how to prevent it?
Well, do not used nested function as a procedural parameter -- if you do not need access to variables or parameters in Q you can move E outside. The assumption when allowing nested functions as functional parameter was that they are used to access lexicals in the containing function.