On Sat, 30 Nov 2002, Martin G C Davies wrote:
Hi,
Testing gpc-20021111 I have hit a problem trying to remove duplicate variables. I've produced a cut-down example and the two sources are:-
mgcd_module.pas
module mgcd_module interface; export mgcd_module = all; var statfile : text; end. module mgcd_module implementation; end.
mgcd_program.pas
program mgcd_program; import mgcd_module; #if __GPC_RELEASE__ < 20021111 var statfile : text; #endif begin rewrite(statfile, 'mgcd.statfile'); writeln(statfile, 'some stats'); end.
I build and run with the command sequence:-
gpc -c mgcd_module.pas gpc -c mgcd_program.pas gpc mgcd_program.o mgcd_module.o a.out
and I get a core dump with gpc-20021111. I used to get a core dump with earlier versions until I used the kludge of the duplicate variable - but this is now illegal. The underlying problem appears to be something to do with file data structures not being initialized.
Adding -g0 to the compile stmts gets rid of the dump and you should get:
a.out: `Unbind' applied to non-bindable TFDD file `(null)' (error #404 at 8049c14)
Hopes this helps, Russ