Re: [Stlport-devel] WCHAR_MAX and USHRT_MAX handling
Brought to you by:
complement
From: <fra...@fr...> - 2007-03-20 22:13:29
|
There are already several issues of 5.1.2 fixed in STLPORT_5_1 branch. I am waiting for your README.evc8 file to release 5.1.3 :-) It looks like you meet the same issue as the one reported here: https://sourceforge.net/forum/forum.php?thread_id=1690171&forum_id=490891 This fatal error only occur when wchar_t is a built-in type, surprising no! Yes I think this test is done to check that WCHAR_MAX is testable, I agree that comparison with USHRT_MAX is surprising, we should perhaps have a test for each macro. AFAIK, conclusion of discussion about WCHAR_MAX was that STLport should try to fix native definition. It is already done for DMC for instance. Maybe we should always redefine those macro to be sure. I also agree that static assertion is weird, I really do not remember how I finally come to this check. It is going to be difficult to check how it behaves on an Alpha platform as I was using one of the Sourceforge compiler farm host for that and this service has been removed... Bests Ulrich Eckhardt wrote: > Greetings! > > I'm currently trying to get 5.1.2 to compile using VC8 and for MS Windows CE5. > I'm getting an error when compiling the unittests in file cwchar.cpp: > > cwchar.cpp(11): fatal error C1017: invalid integer constant expression > > The problem there is the use of WCHAR_MAX, which is defined but not to a > numeric macro suitable for comparisons. Instead, it is defined > to '((wchar_t)-1)'. I'm wondering how this ever worked before? > > Now, the file where the error occurs is basically undocumented. Is it really > the intention to check that the WCHAR_MAX and WCHAR_MIN are defined and > defined properly? If neither are defined, this file compiles okay, so that is > obviously not the point. Then, why does it compare anything with USHRT_MAX? > If this is just supposed to make sure it can be used in comparisons, the > value compared with could be arbitrary. I also remember some discussions in > the forum or the mailinglist concerning the correct definition of WCHAR_MAX > but what was the outcome? Was it that the value should be suitable for > preprocessor comparisons? And shouldn't a test for those values exist anyways > somewhere? > > > Lastly, why is this in stl/_cwchar.h: > > _STLP_STATIC_ASSERT(((wchar_t)-1 > 0) && (WCHAR_MIN < 0)) > > The comment above says that wchar_t for GCC/Alpha is unsigned, so how can the > minimal value be less than zero? > > I hope you can shed some light on the issue. > > cheers > > Uli > > |