This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: V3 PATCH: numeric_limits<> support, fix PR/3865
Gabriel Dos Reis wrote:-
> | Are
> | they going to be enabled only for C++ so C doesn't have to carry the
> | baggage?
>
> The __WCHAR_UNSIGNED__ sign is defined only in C++ as explained.
> However other information about type precision and floating point
> format as defined both in C and C++. Why do you think they are
> unnecessary in C? For proper floating point support in C99 and C++
> (i.e. without mismatch), both languages library supports have to share
> the same information.
Does Glibc not get it right at present?
> | Signedness of wchar_t is easily tested with if () or #if, for example;
> | a macro is quite redundant.
>
> wchar_t is a keyword in C++, how do you easily test its signness with
> if(0 or #if at compile-time and having that information in accordance
> with the compiler's own idea?
if (L'\0' - 1 < 0)
wchar_t_is_signed;
else
wchar_t_is_unsigned;
Similarly for #if.
Neil.