According the document "2 New Features of GNU Pascal," a new feature is "new argument to _p_initialize (@)," where the @ signals a backward incompatibility. However, I can't find any documentation on the new feature.
I'm trying to understand the demo code in gpc_c_c.c and its related files, wherein the line
_p_initialize (argc, argv, envp, 0);
appears. I'm attempting to emulate the C code in Ada, and the Ada compiler tells me "too many arguments in call" when I call it with four arguments. I'm confuzzled. Does gpc_c_c.c still work, calling _p_initialize with four arguments/
Here are the relevant lines from the Ada part:
procedure p_initialize; pragma Import(Convention => C, Entity => p_initialize, Link_Name => "__p_initialize");
p_initialize (Argument_Count + 1, Command_Name, null, 0);
Jerry
lanceboyle@qwest.net wrote:
According the document "2 New Features of GNU Pascal," a new feature is "new argument to _p_initialize (@)," where the @ signals a backward incompatibility. However, I can't find any documentation on the new feature.
See /Developer/Pascal/include/gpc-in-c.h
I'm trying to understand the demo code in gpc_c_c.c and its related files, wherein the line
_p_initialize (argc, argv, envp, 0);
appears. I'm attempting to emulate the C code in Ada, and the Ada compiler tells me "too many arguments in call" when I call it with four arguments. I'm confuzzled. Does gpc_c_c.c still work, calling _p_initialize with four arguments/
Yes, the fourth parameter was new.
Here are the relevant lines from the Ada part:
procedure p_initialize; pragma Import(Convention => C, Entity => p_initialize, Link_Name
=> "__p_initialize");
p_initialize (Argument_Count + 1, Command_Name, null, 0);
The parameters for Ada should be the same as in /Developer/Pascal/gpclibs/include/gpc-in-c.h or as in:
procedure GPC_Initialize (ArgumentCount: CInteger; Arguments, StartEnvironment: PCStrings; Options: CInteger); attribute (name = '_p_initialize');
The latter declaration can only be found in the compiler run-time-library in gcc/p/rts/init.pas (see the compiler sources), but it has already been discussed that the declaration should be added to /Developer/Pascal/gpclibs/units/gpc.pas.
You didn't follow up on your previous question.
Regards,
Adriaan van Os