[Bug other/12782] New: ffi.h #defines ffi_type_[us]long wrong on 32bit arches

a dot rottmann at gmx dot at gcc-bugzilla@gcc.gnu.org
Mon Oct 27 00:47:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12782

           Summary: ffi.h #defines ffi_type_[us]long wrong on 32bit arches
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: other
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: a dot rottmann at gmx dot at
                CC: gcc-bugs at gcc dot gnu dot org

The way ffi.h #defines the ffi_type_XX equivalents to the standard C
types seems bad - they are mixed along with the #defines of the
fixed-bit types (e.g. UINT32), but the two issues are orthogonal. 

This results in ffi_type_ulong, for instance, being #defined to ffi_type_uint64
on (at least) x86, as the following test program indicates:

#include <stdio.h>
#include <ffi.h>

int main ()
{
  printf ("&ffi_type_ulong: %p &ffi_type_uint64: %p\n", 
          &ffi_type_ulong, &ffi_type_uint64);
}

This results in the following output on my Athlon (no, no Athlon64 yet ;-))

&ffi_type_ulong: 0x8049738 &ffi_type_uint64: 0x8049738



More information about the Gcc-bugs mailing list