diff options
author | Tim J. Robbins <tjr@FreeBSD.org> | 2002-10-06 03:20:27 +0000 |
---|---|---|
committer | Tim J. Robbins <tjr@FreeBSD.org> | 2002-10-06 03:20:27 +0000 |
commit | 5b94264c208e2eee704ce67146e52c271dc4ef6f (patch) | |
tree | 2f6c8a318c4c4c9b5eb52c79314a73ee9582e5ea /bin/pax | |
parent | c32049aa33b2ecc27d65ccff016f19f9557a7484 (diff) | |
download | src-5b94264c208e2eee704ce67146e52c271dc4ef6f.tar.gz src-5b94264c208e2eee704ce67146e52c271dc4ef6f.zip |
Fix format string errors relating mainly to the use of %qu to print off_t's.
Instead use %ju and cast the argument.
WFORMAT=0 is still required in the Makefile because gcc warns about
some strftime() calls (I don't think this behaviour is useful.)
Tested on: sparc64, alpha, i386
Notes
Notes:
svn path=/head/; revision=104548
Diffstat (limited to 'bin/pax')
-rw-r--r-- | bin/pax/Makefile | 1 | ||||
-rw-r--r-- | bin/pax/ar_io.c | 15 | ||||
-rw-r--r-- | bin/pax/cpio.c | 5 | ||||
-rw-r--r-- | bin/pax/gen_subs.c | 3 |
4 files changed, 15 insertions, 9 deletions
diff --git a/bin/pax/Makefile b/bin/pax/Makefile index 58b4179b279b..270fc1f6e482 100644 --- a/bin/pax/Makefile +++ b/bin/pax/Makefile @@ -29,7 +29,6 @@ PROG= pax SRCS= ar_io.c ar_subs.c buf_subs.c cache.c cpio.c file_subs.c ftree.c \ gen_subs.c getoldopt.c options.c pat_rep.c pax.c sel_subs.c \ tables.c tar.c tty_subs.c -WARNS= 0 WFORMAT=0 #XXX NOTYET #MAN= pax.1 tar.1 cpio.1 diff --git a/bin/pax/ar_io.c b/bin/pax/ar_io.c index 83bb68d63afc..68762b53d25b 100644 --- a/bin/pax/ar_io.c +++ b/bin/pax/ar_io.c @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include <errno.h> #include <fcntl.h> #include <signal.h> +#include <stdint.h> #include <stdio.h> #include <string.h> #include <stdlib.h> @@ -384,25 +385,29 @@ ar_close(void) if (frmt == NULL) { # ifdef NET2_STAT (void)fprintf(listf, "%s: unknown format, %lu bytes skipped.\n", + argv0, rdcnt); # else - (void)fprintf(listf, "%s: unknown format, %qu bytes skipped.\n", + (void)fprintf(listf, "%s: unknown format, %ju bytes skipped.\n", + argv0, (uintmax_t)rdcnt); # endif - argv0, rdcnt); (void)fflush(listf); flcnt = 0; return; } if (strcmp(NM_CPIO, argv0) == 0) - (void)fprintf(listf, "%qu blocks\n", (rdcnt ? rdcnt : wrcnt) / 5120); + (void)fprintf(listf, "%llu blocks\n", + (unsigned long long)((rdcnt ? rdcnt : wrcnt) / 5120)); else if (strcmp(NM_TAR, argv0) != 0) (void)fprintf(listf, # ifdef NET2_STAT "%s: %s vol %d, %lu files, %lu bytes read, %lu bytes written.\n", + argv0, frmt->name, arvol-1, flcnt, rdcnt, wrcnt); # else - "%s: %s vol %d, %lu files, %qu bytes read, %qu bytes written.\n", + "%s: %s vol %d, %ju files, %ju bytes read, %ju bytes written.\n", + argv0, frmt->name, arvol-1, (uintmax_t)flcnt, + (uintmax_t)rdcnt, (uintmax_t)wrcnt); # endif - argv0, frmt->name, arvol-1, flcnt, rdcnt, wrcnt); (void)fflush(listf); flcnt = 0; } diff --git a/bin/pax/cpio.c b/bin/pax/cpio.c index ed403dbbc1e6..779e5f9b6c07 100644 --- a/bin/pax/cpio.c +++ b/bin/pax/cpio.c @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include <sys/time.h> #include <sys/stat.h> #include <string.h> +#include <stdint.h> #include <stdio.h> #include <unistd.h> #include <stdlib.h> @@ -223,8 +224,8 @@ rd_ln_nm(ARCHD *arcn) paxwarn(1, "Cpio link name length is invalid: %lu", arcn->sb.st_size); # else - paxwarn(1, "Cpio link name length is invalid: %qu", - arcn->sb.st_size); + paxwarn(1, "Cpio link name length is invalid: %ju", + (uintmax_t)arcn->sb.st_size); # endif return(-1); } diff --git a/bin/pax/gen_subs.c b/bin/pax/gen_subs.c index 86e729fa0aa9..9a918243ade6 100644 --- a/bin/pax/gen_subs.c +++ b/bin/pax/gen_subs.c @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include <sys/time.h> #include <sys/stat.h> #include <langinfo.h> +#include <stdint.h> #include <stdio.h> #include <utmp.h> #include <unistd.h> @@ -138,7 +139,7 @@ ls_list(ARCHD *arcn, time_t now, FILE *fp) # ifdef NET2_STAT (void)fprintf(fp, "%9lu ", sbp->st_size); # else - (void)fprintf(fp, "%9qu ", sbp->st_size); + (void)fprintf(fp, "%9ju ", (uintmax_t)sbp->st_size); # endif } |