I don't have access to the source at the moment, but it could also just be templated. Not sure which approach is best<br><div class="gmail_quote"><div dir="ltr">On Thu, Sep 21, 2017 at 1:41 AM Stephan Bergmann via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Seeing the below commit, I wondered whether that's a genuine fix or<br>
rather a workaround for a shortcoming in llvm::ScopedPrinter::printNumber.<br>
<br>
The latter has overloads for [u]int{8,16,32,64}_t, presumably so that it<br>
can take arguments of arbitrary integer types. However, at least on<br>
recent macOS uint64_t is 'unsigned long long' (and uint32_t is 'unsigned<br>
int') while size_t is 'unsigned long', so there's no best matching overload.<br>
<br>
Would it thus be better to change the ScopedPrinter::printNumber to be<br>
overloaded on all the "raw" integer types, instead of the stdint.h typedefs?<br>
<br>
<br>
On 09/20/2017 11:03 PM, Marek Sokolowski via llvm-commits wrote:<br>
> Author: mnbvmar<br>
> Date: Wed Sep 20 14:03:37 2017<br>
> New Revision: 313816<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=313816&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=313816&view=rev</a><br>
> Log:<br>
> [llvm-readobj] Fix 'Teach readobj to dump .res files'.<br>
><br>
> Fix-up for r313790. Some buildbots couldn't convert size_t to<br>
> uint{}_t; do it manually.<br>
><br>
> Modified:<br>
> llvm/trunk/tools/llvm-readobj/WindowsResourceDumper.cpp<br>
><br>
> Modified: llvm/trunk/tools/llvm-readobj/WindowsResourceDumper.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/WindowsResourceDumper.cpp?rev=313816&r1=313815&r2=313816&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/WindowsResourceDumper.cpp?rev=313816&r1=313815&r2=313816&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/tools/llvm-readobj/WindowsResourceDumper.cpp (original)<br>
> +++ llvm/trunk/tools/llvm-readobj/WindowsResourceDumper.cpp Wed Sep 20 14:03:37 2017<br>
> @@ -69,7 +69,7 @@ void Dumper::printEntry(const ResourceEn<br>
> SW.printNumber("Version (major)", Ref.getMajorVersion());<br>
> SW.printNumber("Version (minor)", Ref.getMinorVersion());<br>
> SW.printNumber("Characteristics", Ref.getCharacteristics());<br>
> - SW.printNumber("Data size", Ref.getData().size());<br>
> + SW.printNumber("Data size", (uint64_t)Ref.getData().size());<br>
> SW.printBinary("Data:", Ref.getData());<br>
> SW.startLine() << "\n";<br>
> }<br>
<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>