Wide character types

Andrew Turner andrew at fubar.geek.nz
Wed Jun 6 10:04:10 UTC 2012


I've been working on getting the ARM EABI working with FreeBSD.

As part of the EABI spec the Procedure Call Standard for the ARM
Architecture (AAPCS) defines wchar_t as either an unsigned int or an
unsigned short with the former as the preferred type. FreeBSD defines
wchar_t as a __wchar_t, which is defined as a __ct_rune_t, which is
defined as an int.

wint_t and rune_t are also defined in terms of __ct_rune_t. wint_t must
be a signed type as it needs to hols a WEOF which is defined as -1.

The type of rune_t appears to need to be the same as wint_t as the tow*
and isw* functions are defined as taking a wint_t by the documentation
but __ct_rune_t in the code and compare this value against __rune_t
values.

My question is am I correct in thinking rune_t and wint_t should be
defined as __ct_rune_t with __ct_rune_t defined as an int while wchar_t
should be defined as an unsigned int in ARM EABI and defined as an int
elsewhere?

Andrew


More information about the freebsd-hackers mailing list