[fpc-devel] Bug (Severe): Floating point values completely break GCC Struct compatability with records in 64-bit

Jonas Maebe jonas.maebe at elis.ugent.be
Wed Dec 16 12:55:07 CET 2009

On 16 Dec 2009, at 12:26, Joshua Cearley wrote:

> While working on a binding for the development branch for the  
> Allegro game library I ran in to a bit of a problem in that one of  
> the methods takes a structure of four floating point values (which  
> is how it stores colors) and this is not done through a pointer to a  
> color struct but by passing the structure directly to the method;  
> this never actually works and exploring with GCC shows that the  
> should-be C compatible record built by FPC 2.5 was fine but the  
> version C had was corrupted. I went to FPC 2.4rc1 and tried again,  
> and the same issue remains. 32-bit builds seem to work properly, so  
> I conclude that only the 64-bit version of FPC is emitting broken  
> code.

It seems that passing records with paired float fields is buggy on FPC/ 
x86_64. Please file a bug report.

> I asked in IRC and was referred to here; unfortunately with Snow  
> Leopard GCC compiles in 64-bit by default and so falling back to 32- 
> bit is exceptionally painful.

It's actually quite trivial: just pass "-arch i386" to gcc (or add it  
to CFLAGS in case of a configure/make build system). All system  
libraries are available in both 32 and 64 bit Intel versions.


More information about the fpc-devel mailing list