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.
Note:
See TracTickets
for help on using tickets.
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.