[llvm] r295112 - Use "%zd" format specifier for printing number of testcases executed.

Kostya Serebryany via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 14 14:33:19 PST 2017


On Tue, Feb 14, 2017 at 2:28 PM, Joerg Sonnenberger <joerg at bec.de> wrote:

> On Tue, Feb 14, 2017 at 10:14:36PM -0000, Kostya Serebryany via
> llvm-commits wrote:
> > Author: kcc
> > Date: Tue Feb 14 16:14:36 2017
> > New Revision: 295112
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=295112&view=rev
> > Log:
> > Use "%zd" format specifier for printing number of testcases executed.
>
> It should be %zu?
>

Maybe not.
In 64-bit case it does not matter because the 64-bit counters will take a
millennium to get to 2^63.
In 32-bit case where we have sizeof(size_t)=4, %zd may actually be less
confusing as it will print negative values in case of overflow and more
clearly indicate the problem.

See also https://reviews.llvm.org/D29941#676629





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


More information about the llvm-commits mailing list