[llvm-commits] [llvm] r129340 - in /llvm/trunk: include/llvm/InitializePasses.h include/llvm/LinkAllPasses.h include/llvm/Transforms/Instrumentation.h lib/Transforms/Instrumentation/Instrumentation.cpp lib/Transforms/Instrumentation/LineProfiling

Marshall Clow mclow.lists at gmail.com
Tue Apr 12 12:47:20 PDT 2011

On Apr 12, 2011, at 12:41 PM, Nick Lewycky wrote:

> On 12 April 2011 08:55, Jim Grosbach <grosbach at apple.com> wrote:
> Hi Nick,
> clang is issuing a warning for this. Mind having a look?
> Sorry! I meant for counter to be a uint64_t, and updated that. Neither gcc nor clang warned when I built it this time, but I could imagine that it still might on a different platform. Let me know if it's not fixed past r129380.
> Nick
> llvm[2]: Compiling LineProfiling.c for Debug+Asserts build (PIC)
> /Volumes/Home/grosbaj/sources/llvm/runtime/libprofile/LineProfiling.c:32:25: warning:
>      conversion specifies type 'unsigned long' but the argument has type
>      'int64_t' (aka 'long long') [-Wformat]
>  printf("%s/%s:%u:%u %lu\n", dir, file, line, column, *counter);
>                      ~~^                              ~~~~~~~~
>                      %lld
> 1 warning generated.
> (highlighting points to the "%lu" and "*counter" inputs)

Should the specifier in the printf be "%ull" (or maybe "%llu") to match the "unsigned long long"-ness of counter?

-- Marshall

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110412/fce28a25/attachment.html>

More information about the llvm-commits mailing list