Opened 5 years ago

Last modified 14 months ago

#332 new defect

WCHAR_MIN and WCHAR_MAX

Reported by: komh 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 Changed 14 months ago by dmik

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.

Version 2, edited 14 months ago by dmik (previous) (next) (diff)
Note: See TracTickets for help on using tickets.