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

           Summary: -Wformat gives erronous warning for %lc
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


Compiling the following code with -Wformat generates a warning:

#include <stdio.h>

int main() {
  wchar_t wc = 'x';
  printf("%lc\n", wc);
  return 0;
}

clang -Wformat a.c

/tmp/a.c:5:13: warning: conversion specifies type 'long' but the argument has
type 'wchar_t' (aka 'int')
      [-Wformat]
  printf("%lc\n", wc);
          ~~^     ~~
          %d
1 warning generated.


But AFAIK, the code is correct?

-- 
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to