Subject: snprintf problem compiling bin/dd
To: None <current-users@NetBSD.ORG>
From: Chad Mynhier <mynhier@cs.utk.edu>
List: current-users
Date: 02/06/1998 18:43:47
Is nobody else getting this error in bin/dd?  I've been getting it 
for a few days:

cc -O  -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith  -c misc.c
cc1: warnings being treated as errors
misc.c: In function `summary':
misc.c:87: warning: long long unsigned int format, u_quad_t arg (arg 4)
misc.c:87: warning: long long unsigned int format, u_quad_t arg (arg 6)
*** Error code 1

Stop.

The lines it's complaining about are:

        (void)snprintf(buf, sizeof(buf),
            "%qu bytes transferred in %lu secs (%qu bytes/sec)\n",
            st.bytes, (long) secs, st.bytes / secs);

I finally did the following to get it to compile:

        (void)snprintf(buf, sizeof(buf),
            "%qu bytes transferred in %lu secs (%qu bytes/sec)\n",
            (long long unsigned int)st.bytes, (long) secs, 
            (long long unsigned int)(st.bytes / secs));

but I have my doubts whether it's the "right" thing to do.

Chad Mynhier