Maurice Lombardi wrote:
This is the smallest program which displays the bug
program bug;
var s:string[255]='';
begin s:=s+'a'; s:=s+'b'; end.
It works fine apparently. But by stepping with a debugger, I see that after each string concatenation the stack is increased by 16 bytes. No harm in usual programs since the stack is released at each exit of procedure
Yes, it's a known problem (GPC allocates a temp variable for the concatenation, but does it on a procedure scope, rather than locally in the expression). Has caused me and others some problems as well. I hope Peter can fix it sometime ... :-/ Frank -- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/ GPC To-Do list, latest features, fixed bugs: http://agnes.dida.physik.uni-essen.de/~gnu-pascal/todo.html