[fpc-pascal]How to give an array-of-const to a C ellipse?

Mattias Gaertner nc-gaertnma at netcologne.de
Wed Jul 17 10:48:31 CEST 2002


Hi all,

I have found a problem with 'array of const'. There are two types: The array of variant records and the C-Compiler array used by the 'cdecl;external;'. 
The compiler allows to put the former into the latter, but it does not convert it correctly.
See the program below.

Is there a workaround?



program printftest;

{$mode objfpc}{$H+}

procedure printf(fm: pchar; args: array of const); cdecl; external 'c';

procedure print(i: integer; fm: pchar; args: array of const);
begin
  printf(fm,args);
end;

begin
  print(0,'a number %i '#13#10,[3333]);
end.



Mattias




More information about the fpc-pascal mailing list