WCHAR_MAX question

Artem B. Bityuckiy abityuckiy@yandex.ru
Fri Apr 30 02:14:00 GMT 2004


> 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.



More information about the Newlib mailing list