This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] g++.dg/cpp1y/pr58708.C wchar_t size


On 17 November 2015 at 16:04, David Edelsohn wrote:
> The testcase in the GCC testsuite assumes that wchar_t is 32 bits,
> which is not correct on AIX.  32 bit AIX maintains 16 bit wchar_t for
> backward compatibility (64 bit AIX uses 32 bit wchar_t).
>
> What is the preferred method to make the testcase safe for smaller wchar_t?
>
> The following patch works for me.  I wasn't sure what header file and
> what macro test would be considered portable.  I could include
> stdint.h and compare
>
> WCHAR_MAX == UINT16_MAX
>
> or
>
> WCHAR_MAX < UINT32_MAX

__SIZEOF_WCHAR_T__ is always pre-defined  by the compiler, so that
could be used.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]