Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 03 Jun 2009 11:50:53 +0800
From:      David Xu <davidxu@freebsd.org>
To:        freebsd-amd64@freebsd.org
Subject:   gcc -m32 and int64_t
Message-ID:  <4A25F31D.4040201@freebsd.org>

next in thread | raw e-mail | index | archive | help
It seems there is a problem in /sys/am64/_types.h when cross-compiling a
32-bit code in amd64 machine, the following code prints 4 instead of 8:

/* int64_size.c */

#include <sys/types.h>
#include <stdio.h>

int main()
{
     printf("%d\n", sizeof(int64_t));
     return (0);
}


$cc -m32 -o int64_size -B /usr/lib32/ int64_size.c
$./int64_size
4


Regards,
David Xu



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4A25F31D.4040201>