This is the mail archive of the newlib@sourceware.org mailing list for the newlib 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: [BUG] wprintf(L"%s", str) expects str to be wide


On Jan 10 22:58, Konstantin Isakov wrote:
> Hi,
> 
> This works as expected in glibc:
> 
> #include <stdio.h>
> wprintf(L"Hello, %s\n", "world");
> 
> However, the same thing does not work correctly in newlib. Instead, this works:
> 
> wprintf(L"Hello, %s\n", L"world");

Works as expected for me on Cygwin:

  $ cat > wp.c <<EOF
  #include <stdio.h>

  int
  main ()
  {
    wprintf(L"Hello 1, %s\n", "world");
    wprintf(L"Hello 2, %s\n", L"world");
    wprintf(L"Hello 3, %ls\n", L"world");
    return 0;
  }
  EOF
  $ gcc -g -o wp wp.c
  $ ./wp
  Hello 1, world
  Hello 2, w
  Hello 3, world


Corinna

-- 
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat


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