Re: cvs commit: src/contrib/pf/pfctl pfctl_parser.c

[ Available lists | Index of cvs-all | Month of Jun 2004 | Week of 19 Jun 2004 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
David Schultz <das@FreeBSD.ORG>
Date
19 Jun 2004 07:19:23
Subject
Re: cvs commit: src/contrib/pf/pfctl pfctl_parser.c
Message-ID
20040619071754.GA73529@VARK.homeunix.com


[ Hide this part ]
On Fri, Jun 18, 2004, Maxime Henrion wrote:
> Dag-Erling Sm?rgrav wrote:
> > Max Laier <mlaier@FreeBSD.org> writes:
> > > Log:
> > > Fix printing of u_int64_t with a cast to unsigned long long.
> >
> > The correct fix is to cast it to uintmax_t and print it with %ju.
>
> Using %llu and a cast to (unsigned long long) is as correct as using
> uintmax_t and %ju because the C99 standard says that "long long" is at
> least 64-bit wide. We generally use {u,}intmax_t in FreeBSD because
> it works in more cases, but in that case we can't because OpenBSD
> doesn't have intmax_t.

/me wonders how much backpedaling we'll wind up doing on the
uintmax_t casts when someone decides to add uint128_t to gcc
and uintmax_t becomes painfully slow on 32-bit arches. ;-)


Elapsed time: 0.433 seconds