Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Apr 2002 14:30:23 -0700
From:      Bill Fenner <fenner@electricrain.com>
To:        "J. Mallett" <jmallett@FreeBSD.ORG>
Cc:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/usr.bin/m4 gnum4.c
Message-ID:  <20020420213023.GF855@electricrain.com>
In-Reply-To: <20020420212849.GM20367@FreeBSD.ORG>
References:  <200204202113.g3KLD0d68670@freefall.freebsd.org> <20020420212109.GC855@electricrain.com> <20020420212849.GM20367@FreeBSD.ORG>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Apr 20, 2002 at 09:28:49PM +0000, J. Mallett wrote:
> No, seriously, [putting on dunce cap preemptively] what's %zu?

z is the c99 length modifier for size_t.  So instead of guessing
whether it's better to do %u, %lu or %llu based on what you think
a size_t might end up being, you simply do %zu and that's the right
size.

I made the "blow gcc's mind" comment because I doubt our -Wformat
knows about "z".  I also don't know for sure when the c99 printf
changes will be merged to -stable, which may create maintainability
issues for you.

("man 3 printf" has a nice little table of all the supported
length modifiers; the new ones for c99 are hh, ll, j, t, z.)

  Bill

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020420213023.GF855>