This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

[Bug libstdc++/17005] wide character strings don't work on HP-UX 11i using gcc 3.4.1


------- Additional Comments From pcarlini at suse dot de  2004-08-15 18:06 -------
Hi everyone, hi Dave.

> The wchar_t * in result1 is null.  I'm not sure why.

You mean *result1.data() is a '\0'? Or result1.data() is a null pointer?
In the first case time_put::do_put is totally failing, in the last case even
worse things are happening...

Anyway, time_put::do_put basically does this, in "C terms":

#include <locale.h>
#include <time.h>
#include <wchar.h>
#include <string.h>
#include <assert.h>

int main()
{
  wchar_t __s[64];
  int __maxlen = 64;
  wchar_t __format[3] = L"%a";
  struct tm __tm = { 0, 0, 12, 4, 3, 71, 0, 93, 0 };
  
  wcsftime(__s, __maxlen, __format, &__tm);
  
  assert(wcscmp(__s, L"Sun") == 0);
}

Can you debug a bit further? Thanks, Paolo.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17005


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