This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: time_put+wchar_t issue on solaris with __cplusplus


On Wed, 6 Dec 2006, Marc Glisse wrote:

FAIL:  22_locale/time_put/put/wchar_t/1.cc execution test
FAIL:  22_locale/time_put/put/wchar_t/10.cc execution test
FAIL:  22_locale/time_put/put/wchar_t/5.cc execution test
FAIL:  22_locale/time_put/put/wchar_t/9.cc execution test

Ok I found the problem. On solaris, we have:


#pragma redefine_extname wcsftime __wcsftime_xpg5

This works fine as long as wcsftime is a member of the global namespace, but for some reason it seems to fail if wcsftime is in namespace std:: (even if we are inside an extern "C" block).

We then end up calling a wrong version of wcsftime that interprets the format string as a char* instead of a wchar_t*, and so does not work properly.

Note than sun studio c++ compiler "correctly" handles the pragma.

--
Marc Glisse


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]