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

Joerg Sonnenberger via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 14 14:41:52 PST 2017


On Tue, Feb 14, 2017 at 02:33:19PM -0800, Kostya Serebryany via llvm-commits wrote:
> 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.

It is still plainly the wrong type.

Joerg


More information about the llvm-commits mailing list