[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

Nick Lewycky nlewycky at google.com
Tue Apr 12 12:52:25 PDT 2011


On 12 April 2011 12:47, Marshall Clow <mclow.lists at gmail.com> wrote:

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

Only on 32-bit platforms.

Would you rather I used PRIu64? Will that work on all platforms LLVM
supports, or do I need to add it to DataTypes.h myself? Does Windows have
inttypes.h?

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


More information about the llvm-commits mailing list