Dear all,
The default name for a pascal procedure does not work correctly anymore. (See the output for version number and so on below).
Explicitly declaring the name works, so a workaround is available. That can be done as follows: procedure p_routine; attribute (name='P_routine')
If I am making a mistake somewhere, I would be glad to hear.
Regards,
Marten Jan de Ruiter
% gpc --version gpc 20030830, based on gcc-3.2.1
% cat c_unit.c #include <stdio.h>
extern void c_routine(); extern void P_routine();
void c_routine() { printf("c_routine invoked\n"); P_routine(); printf("c_routine done\n"); }
% cat use_c_unit.p program test_c_unit;
(*$L c_unit.c *)
procedure c_routine; external name 'c_routine' ;
procedure p_routine; begin writeln('pascal routine invoked'); end;
begin c_routine; p_routine; end.
% gpc --automake use_c_unit.p -o use_c_unit c_unit.o: In function `c_routine': c_unit.o(.text+0x13): undefined reference to `P_routine' collect2: ld returned 1 exit status
# hmmm... does P_routine actually exist? Or does it have another name? % gpc -c --automake use_c_unit.p ; grep P_routine use_c_unit.o Binary file use_c_unit.o matches
# Now I am stuck...