This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: Change wchar_t size on ARM Symbian OS
Joseph S. Myers wrote:
On Fri, 6 Aug 2004, Mark Mitchell wrote:
It turns out that our Symbian OS specification was incorrect; wchar_t
should be a 2-byte type by default, not a 4-byte type. I also added a
test that -fno-short-wchar works correctly on Symbian OS.
Is there some reason the 4-byte type should be available with
-fno-short-wchar (so requiring this use of specs), rather than just
defining WCHAR_TYPE to be the specified type (short or unsigned short, as
the case may be)? Plenty of targets define it to "short unsigned int" (or
"short int" in one case).
It's a little bit complicated.
Right now, in arm.h, we have a definition of WCHAR_TYPE that depends on
TARGET_AAPCS_BASED. If we hard-wire it in symbian.h to "short" or
"unsigned short", then using -mabi=xxx for a non-AAPCS ABI will not work
as intended, and we should probably refuse to honor -mabi= for
arm-none-symbianelf.
GCC has no clear policy on which things should be controllable at
run-time for a particular target. Should it be possible to use a
Symbian OS targeted compiler to build non-Symbian code? The general
feeling of the ARM maintainers seems to be that we should strive for
that; the choice of target should just set defaults.
We expect that, in the relatively near future, some new -mabi= flags
(like "aapcs-symbian" or "aapcs-<code>" where "code" indicates things
like "short wchar and long enums") will be added, and then all the specs
in symbian.h will disappear. But, there's some possibility that there
will be well-known names for these settings, and the well-known names
have not been chosen yet, so we are waiting.
--
Mark Mitchell
CodeSourcery, LLC
(916) 791-8304
mark@codesourcery.com