[LLVMbugs] [Bug 5413] New: \u in wide string literals is broken

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Fri Nov 6 08:41:06 PST 2009


http://llvm.org/bugs/show_bug.cgi?id=5413

           Summary: \u in wide string literals is broken
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: parser
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: nicolasweber at gmx.de
                CC: llvmbugs at cs.uiuc.edu


Repro:

thakis-macbookpro:~/src/chrome-git/src thakis$ cat test.c
#include <stdio.h>
#include <wchar.h>

int main() {
  wchar_t* s1 = L"\xFF8e";
  wchar_t* s2 = L"\uFF8e";

  printf("%d\n", sizeof(wchar_t));

  printf("%x\n", s1[0]);
  printf("%x\n", s1[1]);
  printf("%x\n", s2[0]);
  printf("%x\n", s2[1]);
  printf("%x\n", s2[2]);
  printf("%x\n", s2[3]);

}

thakis-macbookpro:~/src/chrome-git/src thakis$ clang -o test test.c
thakis-macbookpro:~/src/chrome-git/src thakis$ ./test
4
ff8e
0
8ebeef
a6425
a7825
0
thakis-macbookpro:~/src/chrome-git/src thakis$ clang --version
clang version 1.1 (trunk 86239)
Target: i386-apple-darwin9
Thread model: posix


I would've expected that both L"\xFF8e" and L"\uFF8e" produce the same data. On
gcc, they do.


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list