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.
Thus the above works with:-
gpc -v Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.8.1/specs gpc version 2.1 (20020510), based on gcc-2.8.1
but fails with:-
gpc -v Reading specs from /ClearCase_01/mgcd/gcc-3.1.1_gpc-20021111_install.dir/lib/gcc-lib/sparc-sun- solaris2.6/3.1.1/specs Configured with: /ClearCase_01/mgcd/gcc-3.1.1/configure --prefix=/ClearCase_01/mgcd/gcc-3.1.1 _gpc-20021111_install.dir : (reconfigured) /ClearCase_01/mgcd/gcc-3.1.1/configure --prefix=/ClearCase_01/mgcd/gcc-3.1.1 _gpc-20021111_install.dir Thread model: posix gpc version 20021111, based on gcc-3.1.1
Hopefully someone can tell me how I can solve/workaround this problem.
Martin G C Davies