Date: Sat, 12 Aug 2000 14:20:15 +0200 From: "Peter 'Luna' Runestig" <peter+freebsd@runestig.com> To: freebsd-questions@FreeBSD.ORG Subject: Strange gcc warning Message-ID: <399540FF.F1853AAF@runestig.com>
next in thread | raw e-mail | index | archive | help
This code (from OpenBSD ftp client):
void
restart(argc, argv)
int argc;
char *argv[];
{
quad_t nrestart_point;
char *ep;
if (argc != 2)
fputs("restart: offset not specified.\n", ttyout);
else {
nrestart_point = strtoq(argv[1], &ep, 10);
if (nrestart_point == QUAD_MAX || *ep != '\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 = 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 Linux
(both i386 though).
--
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ån Charons mörka sund
dödens blund / i dina blickar / bådar 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?399540FF.F1853AAF>
