int64_t and printf

Poul-Henning Kamp phk at phk.freebsd.dk
Sun Jun 5 21:24:07 UTC 2011


In message <4DEBF0E7.3040304 at links.org>, Ben Laurie writes:

>I note that you didn't react to my other wherein you cast from known
>type A to known type B. I supposed it would be smart to also assert that
>the cast was non-narrowing.

Well, if casting to intmax_t is narrowing I think I have bigger
problems on my hands :-)

I've spent a fair amount of time agonizing over this in Varnish and
I came to the conclusion that the my time spent trying to establish
if something narrower than intmax_t was safe would never amortize
the performance difference of printing an intmax_t vs. intN_t, so
now I just cast anything that that's typedef'ed to intmax_t and
move on.

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.


More information about the freebsd-hackers mailing list