Date: Mon, 15 Jul 2002 20:30:51 +1000 (EST) From: Bruce Evans <bde@zeta.org.au> To: Alfred Perlstein <alfred@FreeBSD.org> Cc: Dag-Erling Smorgrav <des@ofug.org>, <cvs-committers@FreeBSD.org>, <cvs-all@FreeBSD.org> Subject: Re: cvs commit: src/usr.bin/tail Makefile tail.c Message-ID: <20020715202642.V40071-100000@gamplex.bde.org> In-Reply-To: <20020715095346.GI77219@elvis.mu.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 15 Jul 2002, Alfred Perlstein wrote:
> Er, both size_t and off_t are pretty much the same one i386 and alpha...
Actually, the are quite different.
> Also, casting enomem of line 257 of reverse.c doesn't fix this warning
> which makes no sense...
>
> Index: reverse.c
> ===================================================================
> RCS file: /home/ncvs/src/usr.bin/tail/reverse.c,v
> retrieving revision 1.16
> diff -u -r1.16 reverse.c
> --- reverse.c 13 Apr 2002 20:59:48 -0000 1.16
> +++ reverse.c 15 Jul 2002 09:49:52 -0000
> @@ -254,7 +254,7 @@
> }
>
> if (enomem) {
> - warnx("warning: %qd bytes discarded", enomem);
> + warnx("warning: %qd bytes discarded", (quad_t)enomem);
> rval = 1;
> }
This makes sense. %qd is just an alias for %lld, so it unsuitable for
printing anything except long longs. Neither off_t nor quad_t is long
long on alphas.
> cc -O -pipe -mcpu=ev56 -Wall -Wno-format-y2k -Wno-uninitialized -c reverse.c
> reverse.c: In function `r_buf':
> reverse.c:257: warning: long long int format, off_t arg (arg 2)
>
> from printf(3):
>
> Modifier d, i o, u, x, X n
> ...
> q (deprecated) quad_t u_quad_t quad_t *
>
> ???
>
> Whatever, it's backed out.
This says that %qd should never be used.
Bruce
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?20020715202642.V40071-100000>
