[LLVMbugs] [Bug 8781] -Wformat warns about using wchar_t with %d

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Dec 13 11:20:41 PST 2010


Dale Johannesen <dalej at apple.com> changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
                 CC|                            |dalej at apple.com
         Resolution|                            |INVALID

--- Comment #1 from Dale Johannesen <dalej at apple.com> 2010-12-13 13:20:41 CST ---
There doesn't seem to be a defined way to print a wchar_t as an integer in the
standards, so I think the current behavior is reasonable.  Both the size and
signedness of wchar_t are implementation-defined.  They're going to match one
of the other integer types and you can argue that the way you print that
integer type (usually %lld) should not warn when given a wchar_t., but that is
not portable.  The portable way to do this is with a cast; I think it's
reasonable to warn on code that doesn't do that.

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