This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
Re: WCHAR_MAX question
- From: "Artem B. Bityuckiy" <abityuckiy at yandex dot ru>
- To: newlib at sources dot redhat dot com
- Cc: Jeff Johnston <jjohnstn at redhat dot com>
- Date: Thu, 29 Apr 2004 10:34:16 +0400
- Subject: Re: WCHAR_MAX question
- References: <408FFE45.2090401@yandex.ru> <409021B6.5080302@redhat.com>
The correct way it should be done is to have the compiler generate a
macro for it. As it turns out, the gcc compiler has __WCHAR_MAX__ as
one of it's default builtins which is why the code is defined as it is.
See c-cppbuiltin.c in the gcc directory.
For non-gcc compilers, we are defaulting the maximum value which I do
not think a bad thing as most wchar_t implementations use 4-byte values
for obvious reasons.
I agree that the most right way is to use GCC's predefined macro like
__WCHAR_MAX__. BUT! There is no such macro in gcc-3.2! What version of
gcc did you mention? I did 'grep -r WCHAR_MAX gcc-3.2/*' and didn't
found anything interesting...
--
Best Regards,
Artem B. Bityuckiy,
St.-Petersburg, Russia.