[fpc-devel] Problem with open arrays

Jonas Maebe jonas.maebe at elis.ugent.be
Tue Aug 15 13:23:05 CEST 2006


On 15 Aug 2006, at 13:09, Peter Popov wrote:

> Well, what I mean is that C++ Builder specifically specifies how  
> Delphi (Object Pascal) open array parameters should be viewed from C 
> ++. If this is the current FPC standard this is good. On the other  
> hand FPC does not allow cdecl functions with open arrays (see  
> http://www.freepascal.org/mantis/view.php?id=6940), which is  
> exactly what you would need to interface with a C++ library.

I agree with Ido the only proper way is to explicitly encode this  
view in your parameter declaration. There are more compilers than C+ 
+Builder and more Pascal compilers than just FPC (and more platforms  
than Win32/i386).

E.g. simply changing from a 32 to 64 bit platform may already break  
things otherwise (because e.g. the C "int" remains 32 bit while the  
implicit high parameter becomes 64 bit, or vice versa -- I don't know  
by heart what the size is of the high parameter on FPC 64 bit  
platforms, but I guess it's 64 bit).


Jonas



More information about the fpc-devel mailing list