I ported some code to gpc 2.0, i make the test in home with a linux rh
5.2, whit this piece of code, all works fine:
program test;
procedure test( s: string);
begin
writeln('String:',s);
end;
begin
test('Esto es de prueba');
end.
But when i put the procedure prueba in a unit, it crash:
<<modulo.p>>
unit modulo;
interface
procedure prueba( s: string);
implementation
procedure prueba( s: string);
begin
writeln('Cadena:',s);
end;
end.
<<prueba.p>>
program Prueba;
uses modulo;
begin
prueba('Esto es de prueba');
end.
And this is the output:
Cadena:E
Segmentation fault (core dumped)
And this with xxgdb:
(xxgdb) list modulo.p:1
(xxgdb) tbreak 11
Breakpoint 1 at 0x8048d93: file modulo.p, line 11.
(xxgdb) run
Prueba (S={Capacity = 0, length = 17, string = 0xbffffd88}) at
modulo.p:11
The diference is te Capacity = 0, with the first code its run fine???
What can i do????
I need this work in gpc 2.0 because is the compiler that have the
machine, in that i must drop the practics