[LLVMbugs] [Bug 23412] New: -Wformat warns when using format specifier macros from MS headers

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon May 4 14:49:03 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=23412

            Bug ID: 23412
           Summary: -Wformat warns when using format specifier macros from
                    MS headers
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: hans at chromium.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

For example:

#include <inttypes.h>
#include <stdio.h>

void f(uint32_t i) {
    printf("%" PRIx32 "\n", i);
}

Generates this:

d:\src\tmp\a.c:5:26: warning: format specifies type 'unsigned long' but the
      argument has type 'uint32_t' (aka 'unsigned int') [-Wformat]
        printf("%" PRIx32 "\n", i);
                ~~~             ^
1 warning generated.


It seems 32-bit format specifier macros are prefixed with 'l' in the Visual
Studio headers.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150504/e793baf4/attachment.html>


More information about the llvm-bugs mailing list