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

            Bug ID: 20715
           Summary: llvm::format() prints incorrect values for %ul
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Support Libraries
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Example code:

StringRef lol="hi";
dbgs()<< format("%s %lu",lol, 1)<<"\n";

Expected Output:
hi 1

Actual Output:
hi 2

In general the number printed out will be some arbitrary number around the
range of 0-40 rather than the actual value of the argument given.

The bug is not present with format strings %d and %u, but still is present with
%llu.  If the %s is not present before the %ul, I wasn't able to reproduce the
bug, but  I didn't try very hard.  

Luckily in my use case it was obvious that the values printed were wrong, but
this could potentially cause tools using format() to give extremely misleading
output.

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