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

            Bug ID: 16384
           Summary: -Wformat highlights incorrect range when using
                    cinttypes macros
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Example:

⑆ cat main.cpp 
#include <cstdio>
#include <cstdint>
#include <cinttypes>

int main() {
  std::printf("%" PRIu32 "\n", std::uint64_t{100});
}

⑆ clang++ -std=c++11 -stdlib=libc++ -Wall main.cpp
main.cpp:6:32: warning: format specifies type 'unsigned int' but the argument
has type 'std::uint64_t' (aka 'unsigned long long') [-Wformat]
  std::printf("%" PRIu32 "\n", std::uint64_t{100});
               ~~~             ^
1 warning generated.

Expected results:

  std::printf("%" PRIu32 "\n", std::uint64_t{100});
               ~~~~~~~~~       ^

The highlighting for the argument might also be improved:

  std::printf("%" PRIu32 "\n", std::uint64_t{100});
               ~~~~~~~~~       ^~~~~~~~~~~~~~~~~~

-- 
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