Bug 186247 - <machine/_types.h> defines int64_t/uint64_t incorrectly
Summary: <machine/_types.h> defines int64_t/uint64_t incorrectly
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
Depends on:
Reported: 2014-01-29 17:20 UTC by Ivan Kosarev
Modified: 2014-06-09 15:39 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Kosarev 2014-01-29 17:20:00 UTC
The file:



typedef long __int64_t;
typedef unsigned long __uint64_t;

This causes types int64_t and uint64_t be of width 32 when being compiled in the 32-bit mode.


These definitions:

typedef long __int64_t;
typedef unsigned long __uint64_t;

should be replaced with something like:

#if defined(__LP64__)
typedef long __int64_t;
typedef unsigned long __uint64_t;
typedef long long __int64_t;
typedef unsigned long long __uint64_t;
How-To-Repeat: $ cat x.c
#include <stdio.h>
#include <stdint.h>

int main(void)
    printf("%d\n", sizeof(uint64_t));
    return 0;
$ gcc -m32 -B/usr/lib32 x.c
$ ./a.out
Comment 1 Ed Maste freebsd_committer 2014-02-21 19:25:11 UTC
State Changed
From-To: open->patched

amd64 and i386 _types.h merged into x86/_types.h in r232261 
Comment 2 Ed Maste freebsd_committer 2014-06-09 15:39:35 UTC
Merged to stable/9: http://svnweb.freebsd.org/changeset/base/263505
Will be in FreeBSD 9.3