Hi!
The problem is at compile-time, attached is a small module which exhibits this behaviour. My system is Red Hat Linux release 5.2 (Apollo) running kernel 2.0.36 on an i586. I've built gcc-2.8.1 and gpc 19990118.
gpc -v gives the following output ----------------------------------------------------------------- Reading specs from /usr/lib/gcc-lib/i586-pc-linux-gnu/2.8.1/specs gpc version 19990118, based on gcc-2.8.1 -----------------------------------------------------------------
Thanks for the detailed information. :-) Below is a version of your test program that is ready for our test suite. To work around the bug, you can drop the first `protected'. BTW, here are some off-topic remarks: * In this example we are mixing Extended Pascal modules with UCSD (Borland) Pascal units. EP wants `import' instead of `uses'. * `MoveLeft' is also an UCSD extension not present in EP. * `SetLength' is a GPC/Delphi extension. While GPC accepts all this, it is maybe better to stick to one flavour of modularized Pascal programming which means either EP-style modules or UCSD-style unit, but not a mixture. Furthermore if I would write an EP-style module at all, I would not use non-EP extensions. But it's a matter of taste, of course. Thanks for the well-written bug report, Peter -- Peter Gerwinski, Essen, Germany, http://home.pages.de/~Peter.Gerwinski/ Maintainer GNU Pascal - http://home.pages.de/~GNU-Pascal/ - gpc-19990118 PGP key on request - 6C 94 45 BE 28 A4 96 - 0E CC E9 12 47 25 82 75 *** Vote against SPAM! ********* http://www.politik-digital.de/spam/ *** 8< ---- daj1.pas ----------------------------------------------- Program Daj; uses DajMod in 'dajmod1.pas'; Var OK: String ( 2 ); begin str_tail ( 'DIESELLOK', 2, OK ); writeln ( OK ); end. 8< ---- dajmod1.pas -------------------------------------------- module dajmod1 interface; export dajmod = (str_tail); procedure str_tail(protected source:string;protected i:integer;var dest:string); end. module dajmod1 implementation; uses gpc; var s1,s2:string(255); i:integer; procedure str_tail; var s2:string(255); begin (*str_tail*) if (length(source)=0) or (i<1) or (i>length(source)) then dest:='' else begin moveleft(source[length(source)-i+1], s2[1], i); (*$x+*) setlength(s2,i); (*$x-*) dest:=s2; end; end; (*str_tail*) end.