From owner-freebsd-questions Sun Aug 13 1:32:59 2000 Delivered-To: freebsd-questions@freebsd.org Received: from arthur.runestig.com (arthur.RUNESTIG.com [194.18.83.85]) by hub.freebsd.org (Postfix) with ESMTP id 0C78A37BC88 for ; Sun, 13 Aug 2000 01:32:55 -0700 (PDT) (envelope-from peter+freebsd@runestig.com) Received: from runestig.com (kldata.runestig.com [194.18.83.84]) by arthur.runestig.com (8.9.3/8.9.3) with ESMTP id JAA00683; Sun, 13 Aug 2000 09:53:16 +0200 Message-ID: <39965EA4.3496B441@runestig.com> Date: Sun, 13 Aug 2000 10:39:00 +0200 From: "Peter 'Luna' Runestig" X-Mailer: Mozilla 4.73 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: freebsd-questions@FreeBSD.ORG Cc: gcc-bugs@gcc.gnu.org Subject: Re: Strange gcc warning References: <399540FF.F1853AAF@runestig.com> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Peter 'Luna' Runestig wrote: > = > This code (from OpenBSD ftp client): > = > void > restart(argc, argv) > int argc; > char *argv[]; > { > quad_t nrestart_point; > char *ep; > = > if (argc !=3D 2) > fputs("restart: offset not specified.\n", ttyout); > else { > nrestart_point =3D strtoq(argv[1], &ep, 10); > if (nrestart_point =3D=3D QUAD_MAX || *ep !=3D '\0') > fputs("restart: invalid offset.\n", ttyout); > else { > fprintf(ttyout, "Restarting at %qd. Execute get= , > put or" > "append to initiate transfer\n", > /* line 2169 */ nrestart_point); > restart_point =3D nrestart_point; > } > } > } > = > gives this warning, compiling on FreeBSD 4.0-20000101-CURRENT alpha: > = > gcc -c -g -O2 -Wall -Wno-unused -I/house/luna/bsd_a/include -I./libedit= > -DHAVE_CONFIG_H -I. -o cmds.o cmds.c > cmds.c: In function `restart': > cmds.c:2169: warning: long long int format, quad_t arg (arg 3) > = > Why? The format is "%qd" and the variable nrestart_point is a quad_t. > Shouldn't be any problems, right? It compiles clean on OpenBSD and Linu= x > (both i386 though). I have it figured out now. quad_t on alpha is a long, not a long long as on i386, but gcc still treats the "%qd" as a long long format. A small gcc bug perhaps? -- = Peter "Luna" Runestig (fd. Altberg), Sweden PGP Key ID: 0xD07BBE13 Fingerprint: 7B5C 1F48 2997 C061 DE4B 42EA CB99 A35C D07B BE13 Gubben Movitz ler och nickar, / men fr=E5n Charons m=F6rka sund d=F6dens blund / i dina blickar / b=E5dar snart din sista stund. Carl Michael Bellman, Fredmans epistel nr 34 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message