Opened 10 years ago

Last modified 6 years ago

#332 new defect

WCHAR_MIN and WCHAR_MAX

Reported by: KO Myung-Hun Owned by:
Priority: normal Milestone: libc-0.7
Component: libc Version: 0.6.6
Severity: normal Keywords:
Cc:

Description

Hi/2.

Currently WCHAR_MIN and WCHAR_MAX is defined as __INT_MIN and __INT_MAX in wchar.h, and INT32_MIN and INT32_MAX in 386/_stdint.h.

But __wchar_t in sys/_types.h is unsinged short.

So WCHAR_MIN and WCHAR_MAX should be defined as 0 and __USHRT_MAX/USHRT_MAX, respectively.

Change History (1)

comment:1 by dmik, 6 years ago

You can actually use __WCHAR_MIN__ and __WCHAR_MAX__ gcc built in defines for this: they always match the real wchar_t size.

See also https://github.com/psmedley/gcc/issues/30 and https://github.com/bitwiseworks/libc/issues/8.

Last edited 6 years ago by dmik (previous) (diff)
Note: See TracTickets for help on using tickets.