diff options
| author | is <is@NetBSD.org> | 2000-10-11 14:46:00 +0000 |
|---|---|---|
| committer | is <is@NetBSD.org> | 2000-10-11 14:46:00 +0000 |
| commit | 135600f947515ab4875cf9eeb52f50b228ab4bb8 (patch) | |
| tree | 58946c777c26fe581fc0d7af24766f01fbbfcc4e | |
| parent | 745fefd1c6cd80f1ebe12f2afe6e1a6c0490da34 (diff) | |
More format string cleanup by sommerfeld.
70 files changed, 324 insertions, 251 deletions
diff --git a/usr.bin/Makefile.inc b/usr.bin/Makefile.inc index 69fac562962..567182d4913 100644 --- a/usr.bin/Makefile.inc +++ b/usr.bin/Makefile.inc @@ -1,5 +1,7 @@ -# $NetBSD: Makefile.inc,v 1.5 1997/10/20 03:54:16 lukem Exp $ +# $NetBSD: Makefile.inc,v 1.6 2000/10/11 14:46:00 is Exp $ # from: @(#)Makefile.inc 8.1 (Berkeley) 6/6/93 WARNS?= 1 +WFORMAT?= 2 +WFORMAT?= 2 BINDIR?=/usr/bin diff --git a/usr.bin/cdplay/cdplay.c b/usr.bin/cdplay/cdplay.c index 960dc1ee412..cba153d5e1d 100644 --- a/usr.bin/cdplay/cdplay.c +++ b/usr.bin/cdplay/cdplay.c @@ -1,4 +1,4 @@ -/* $NetBSD: cdplay.c,v 1.9 2000/08/30 10:13:53 abs Exp $ */ +/* $NetBSD: cdplay.c,v 1.10 2000/10/11 14:46:01 is Exp $ */ /* * Copyright (c) 1999 Andrew Doran. @@ -56,7 +56,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: cdplay.c,v 1.9 2000/08/30 10:13:53 abs Exp $"); +__RCSID("$NetBSD: cdplay.c,v 1.10 2000/10/11 14:46:01 is Exp $"); #endif /* not lint */ #include <sys/endian.h> @@ -285,9 +285,7 @@ main(argc, argv) } while (!arg); if (run(cmd, arg) < 0) { - /* XXX damned -Wall */ - char *null = NULL; - warn(null); + warn(NULL); close(fd); fd = -1; } diff --git a/usr.bin/chpass/pw_yp.c b/usr.bin/chpass/pw_yp.c index 563bca70377..b82ada86f64 100644 --- a/usr.bin/chpass/pw_yp.c +++ b/usr.bin/chpass/pw_yp.c @@ -1,4 +1,4 @@ -/* $NetBSD: pw_yp.c,v 1.16 2000/10/04 08:38:09 itojun Exp $ */ +/* $NetBSD: pw_yp.c,v 1.17 2000/10/11 14:46:01 is Exp $ */ /* * Copyright (c) 1988 The Regents of the University of California. @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)pw_yp.c 1.0 2/2/93"; #else -__RCSID("$NetBSD: pw_yp.c,v 1.16 2000/10/04 08:38:09 itojun Exp $"); +__RCSID("$NetBSD: pw_yp.c,v 1.17 2000/10/11 14:46:01 is Exp $"); #endif #endif /* not lint */ @@ -321,7 +321,7 @@ yppw_error(name, err, eval) if (name) warn("%s", name); else - warn(name); + warn(NULL); } errx(eval, "YP passwd information unchanged"); diff --git a/usr.bin/compress/compress.c b/usr.bin/compress/compress.c index 6355e0bac4f..144936eb596 100644 --- a/usr.bin/compress/compress.c +++ b/usr.bin/compress/compress.c @@ -1,4 +1,4 @@ -/* $NetBSD: compress.c,v 1.17 1998/10/08 01:56:28 wsanchez Exp $ */ +/* $NetBSD: compress.c,v 1.18 2000/10/11 14:46:02 is Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1992, 1993\n\ #if 0 static char sccsid[] = "@(#)compress.c 8.2 (Berkeley) 1/7/94"; #else -__RCSID("$NetBSD: compress.c,v 1.17 1998/10/08 01:56:28 wsanchez Exp $"); +__RCSID("$NetBSD: compress.c,v 1.18 2000/10/11 14:46:02 is Exp $"); #endif #endif /* not lint */ @@ -65,8 +65,8 @@ __RCSID("$NetBSD: compress.c,v 1.17 1998/10/08 01:56:28 wsanchez Exp $"); #endif void compress __P((char *, char *, int)); -void cwarn __P((const char *, ...)); -void cwarnx __P((const char *, ...)); +void cwarn __P((const char *, ...)) __attribute__((__format__(__printf__,1,2))); +void cwarnx __P((const char *, ...)) __attribute__((__format__(__printf__,1,2))); void decompress __P((char *, char *, int)); int permission __P((char *)); void setfile __P((char *, struct stat *)); diff --git a/usr.bin/error/Makefile b/usr.bin/error/Makefile index 2728ff58625..e911df1ae40 100644 --- a/usr.bin/error/Makefile +++ b/usr.bin/error/Makefile @@ -1,7 +1,7 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 -# $NetBSD: Makefile,v 1.3 1995/09/02 06:15:10 jtc Exp $ +# $NetBSD: Makefile,v 1.4 2000/10/11 14:46:02 is Exp $ PROG= error SRCS= main.c input.c pi.c subr.c filter.c touch.c - +WFORMAT=1 .include <bsd.prog.mk> diff --git a/usr.bin/error/touch.c b/usr.bin/error/touch.c index bc146f79b7f..3cfdd53c121 100644 --- a/usr.bin/error/touch.c +++ b/usr.bin/error/touch.c @@ -1,4 +1,4 @@ -/* $NetBSD: touch.c,v 1.9 1999/11/06 15:11:46 kleink Exp $ */ +/* $NetBSD: touch.c,v 1.10 2000/10/11 14:46:02 is Exp $ */ /* * Copyright (c) 1980, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)touch.c 8.1 (Berkeley) 6/6/93"; #endif -__RCSID("$NetBSD: touch.c,v 1.9 1999/11/06 15:11:46 kleink Exp $"); +__RCSID("$NetBSD: touch.c,v 1.10 2000/10/11 14:46:02 is Exp $"); #endif /* not lint */ #include <sys/param.h> @@ -173,10 +173,11 @@ filenames(nfiles, files) if (nfiles){ someerrors++; - fprintf(stdout, terse - ? "%d file%s" - : "%d file%s contain%s errors", - nfiles, plural(nfiles), verbform(nfiles)); + if (terse) + fprintf(stdout, "%d file%s", nfiles, plural(nfiles)); + else + fprintf(stdout, "%d file%s contain%s errors", + nfiles, plural(nfiles), verbform(nfiles)); if (!terse){ FILEITERATE(fi, 1){ fprintf(stdout, "%s\"%s\" (%d)", diff --git a/usr.bin/fgen/fgen.l b/usr.bin/fgen/fgen.l index 5023c3114e7..71f1acdf88f 100644 --- a/usr.bin/fgen/fgen.l +++ b/usr.bin/fgen/fgen.l @@ -1,5 +1,5 @@ %{ -/* $NetBSD: fgen.l,v 1.9 2000/04/14 06:11:07 simonb Exp $ */ +/* $NetBSD: fgen.l,v 1.10 2000/10/11 14:46:02 is Exp $ */ /* FLEX input for FORTH input file scanner */ /* * Copyright (c) 1998 Eduardo Horvath. @@ -91,7 +91,8 @@ Cell parse_stack[PSTKSIZ]; int parse_stack_ptr = 0; int main __P((int, char *[])); -void token_err __P((int, char *, char *, char *, ...)); +void token_err __P((int, char *, char *, char *, ...)) + __attribute__((__format__(__printf__, 4, 5))); YY_DECL; int debug = 0; diff --git a/usr.bin/file/Makefile b/usr.bin/file/Makefile index 192b661e358..82f254cdeda 100644 --- a/usr.bin/file/Makefile +++ b/usr.bin/file/Makefile @@ -1,7 +1,8 @@ -# $NetBSD: Makefile,v 1.25 2000/09/22 16:34:59 pooka Exp $ +# $NetBSD: Makefile,v 1.26 2000/10/11 14:46:03 is Exp $ .include <bsd.own.mk> +WFORMAT= 1 MFILESDIR= /usr/share/misc MFILES= magic magic.mime MAGIC= ${MFILESDIR}/magic diff --git a/usr.bin/ftp/cmds.c b/usr.bin/ftp/cmds.c index 13f66ab5601..7d6ac6cd223 100644 --- a/usr.bin/ftp/cmds.c +++ b/usr.bin/ftp/cmds.c @@ -1,4 +1,4 @@ -/* $NetBSD: cmds.c,v 1.90 2000/08/01 22:47:25 lukem Exp $ */ +/* $NetBSD: cmds.c,v 1.91 2000/10/11 14:46:03 is Exp $ */ /*- * Copyright (c) 1996-2000 The NetBSD Foundation, Inc. @@ -107,7 +107,7 @@ #if 0 static char sccsid[] = "@(#)cmds.c 8.6 (Berkeley) 10/9/94"; #else -__RCSID("$NetBSD: cmds.c,v 1.90 2000/08/01 22:47:25 lukem Exp $"); +__RCSID("$NetBSD: cmds.c,v 1.91 2000/10/11 14:46:03 is Exp $"); #endif #endif /* not lint */ @@ -1645,6 +1645,12 @@ do_chmod(int argc, char *argv[]) (void)command("SITE CHMOD %s %s", argv[1], argv[2]); } +#define COMMAND_1ARG(argc, argv, cmd) \ + if (argc == 1) \ + command(cmd); \ + else \ + command(cmd " %s", argv[1]) + void do_umask(int argc, char *argv[]) { @@ -1656,7 +1662,7 @@ do_umask(int argc, char *argv[]) return; } verbose = 1; - (void)command(argc == 1 ? "SITE UMASK" : "SITE UMASK %s", argv[1]); + COMMAND_1ARG(argc, argv, "SITE UMASK"); verbose = oldverbose; } @@ -1671,7 +1677,7 @@ idlecmd(int argc, char *argv[]) return; } verbose = 1; - (void)command(argc == 1 ? "SITE IDLE" : "SITE IDLE %s", argv[1]); + COMMAND_1ARG(argc, argv, "SITE IDLE"); verbose = oldverbose; } @@ -1689,7 +1695,7 @@ rmthelp(int argc, char *argv[]) return; } verbose = 1; - (void)command(argc == 1 ? "HELP" : "HELP %s", argv[1]); + COMMAND_1ARG(argc, argv, "HELP"); verbose = oldverbose; } @@ -2452,7 +2458,7 @@ rmtstatus(int argc, char *argv[]) code = -1; return; } - (void)command(argc > 1 ? "STAT %s" : "STAT" , argv[1]); + COMMAND_1ARG(argc, argv, "STAT"); } /* @@ -2673,7 +2679,7 @@ mlst(int argc, char *argv[]) return; } verbose = 1; /* If we aren't verbose, this doesn't do anything! */ - (void)command(argc == 1 ? "MLST" : "MLST %s", argv[1]); + COMMAND_1ARG(argc, argv, "MLST"); verbose = oldverbose; } @@ -2693,6 +2699,9 @@ opts(int argc, char *argv[]) return; } verbose = 1; /* If we aren't verbose, this doesn't do anything! */ - (void)command(argc == 2 ? "OPTS %s" : "OPTS %s %s", argv[1], argv[2]); + if (argc == 2) + command("OPTS %s", argv[1]); + else + command("OPTS %s %s", argv[1], argv[2]); verbose = oldverbose; } diff --git a/usr.bin/ftp/extern.h b/usr.bin/ftp/extern.h index ba8402b9d13..0c2cbc03768 100644 --- a/usr.bin/ftp/extern.h +++ b/usr.bin/ftp/extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.59 2000/08/06 08:51:22 lukem Exp $ */ +/* $NetBSD: extern.h,v 1.60 2000/10/11 14:46:03 is Exp $ */ /*- * Copyright (c) 1996-2000 The NetBSD Foundation, Inc. @@ -122,7 +122,8 @@ void cleanuppeer(void); void cmdabort(int); void cmdtimeout(int); void cmdscanner(void); -int command(const char *, ...); +int command(const char *, ...) + __attribute__((__format__(__printf__, 1, 2))); #ifndef NO_EDITCOMPLETE unsigned char complete(EditLine *, int); void controlediting(void); diff --git a/usr.bin/ftp/ftp.c b/usr.bin/ftp/ftp.c index cb6c7629579..fd247bbec8d 100644 --- a/usr.bin/ftp/ftp.c +++ b/usr.bin/ftp/ftp.c @@ -1,4 +1,4 @@ -/* $NetBSD: ftp.c,v 1.109 2000/09/28 12:29:24 lukem Exp $ */ +/* $NetBSD: ftp.c,v 1.110 2000/10/11 14:46:03 is Exp $ */ /*- * Copyright (c) 1996-2000 The NetBSD Foundation, Inc. @@ -103,7 +103,7 @@ #if 0 static char sccsid[] = "@(#)ftp.c 8.6 (Berkeley) 10/27/94"; #else -__RCSID("$NetBSD: ftp.c,v 1.109 2000/09/28 12:29:24 lukem Exp $"); +__RCSID("$NetBSD: ftp.c,v 1.110 2000/10/11 14:46:03 is Exp $"); #endif #endif /* not lint */ @@ -1331,7 +1331,8 @@ initconn(void) switch (data_addr.su_family) { case AF_INET: if (epsv4 && !epsv4bad) { - result = command(pasvcmd = "EPSV"); + pasvcmd = "EPSV"; + result = command("EPSV"); if (!connected) return (1); /* @@ -1353,14 +1354,16 @@ initconn(void) } } if (result != COMPLETE) { - result = command(pasvcmd = "PASV"); + pasvcmd = "PASV"; + result = command("PASV"); if (!connected) return (1); } break; #ifdef INET6 case AF_INET6: - result = command(pasvcmd = "EPSV"); + pasvcmd = "EPSV"; + result = command("EPSV"); if (!connected) return (1); /* this code is to be friendly with broken BSDI ftpd */ @@ -1370,8 +1373,10 @@ initconn(void) ttyout); result = COMPLETE + 1; } - if (result != COMPLETE) - result = command(pasvcmd = "LPSV"); + if (result != COMPLETE) { + pasvcmd = "LPSV"; + result = command("LPSV"); + } if (!connected) return (1); break; diff --git a/usr.bin/hexdump/Makefile b/usr.bin/hexdump/Makefile index 943ff38c786..da83339a38b 100644 --- a/usr.bin/hexdump/Makefile +++ b/usr.bin/hexdump/Makefile @@ -1,9 +1,10 @@ -# $NetBSD: Makefile,v 1.5 1997/10/18 13:53:56 mrg Exp $ +# $NetBSD: Makefile,v 1.6 2000/10/11 14:46:04 is Exp $ # from: @(#)Makefile 8.1 (Berkeley) 6/6/93 PROG= hexdump SRCS= conv.c display.c hexdump.c hexsyntax.c odsyntax.c parse.c MAN= hexdump.1 od.1 LINKS= ${BINDIR}/hexdump ${BINDIR}/od +WFORMAT= 1 .include <bsd.prog.mk> diff --git a/usr.bin/id/Makefile b/usr.bin/id/Makefile index 8f402820779..4a5b29b3f24 100644 --- a/usr.bin/id/Makefile +++ b/usr.bin/id/Makefile @@ -1,9 +1,10 @@ -# $NetBSD: Makefile,v 1.8 1998/10/14 00:55:03 wsanchez Exp $ +# $NetBSD: Makefile,v 1.9 2000/10/11 14:46:04 is Exp $ # from: @(#)Makefile 8.1 (Berkeley) 6/6/93 PROG= id MAN= id.1 groups.1 whoami.1 LINKS= ${BINDIR}/id ${BINDIR}/groups LINKS+= ${BINDIR}/id ${BINDIR}/whoami +WFORMAT=1 .include <bsd.prog.mk> diff --git a/usr.bin/indent/Makefile b/usr.bin/indent/Makefile index 3ab509338ff..ac5bb577112 100644 --- a/usr.bin/indent/Makefile +++ b/usr.bin/indent/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.4 1997/10/18 16:04:21 mrg Exp $ +# $NetBSD: Makefile,v 1.5 2000/10/11 14:46:04 is Exp $ # from: @(#)Makefile 8.1 (Berkeley) 6/6/93 PROG= indent SRCS= indent.c io.c lexi.c parse.c pr_comment.c args.c - +WFORMAT=1 .include <bsd.prog.mk> diff --git a/usr.bin/jot/Makefile b/usr.bin/jot/Makefile index 8fef9215389..b9a61cea212 100644 --- a/usr.bin/jot/Makefile +++ b/usr.bin/jot/Makefile @@ -1,6 +1,7 @@ -# $NetBSD: Makefile,v 1.2 1994/11/14 20:27:34 jtc Exp $ +# $NetBSD: Makefile,v 1.3 2000/10/11 14:46:05 is Exp $ # @(#)Makefile 8.1 (Berkeley) 6/6/93 PROG= jot +WFORMAT=1 .include <bsd.prog.mk> diff --git a/usr.bin/kdump/Makefile b/usr.bin/kdump/Makefile index a83297a330d..622c0e94baf 100644 --- a/usr.bin/kdump/Makefile +++ b/usr.bin/kdump/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.14 2000/04/10 09:13:45 jdolecek Exp $ +# $NetBSD: Makefile,v 1.15 2000/10/11 14:46:05 is Exp $ # @(#)Makefile 8.1 (Berkeley) 6/6/93 .include <bsd.own.mk> @@ -9,7 +9,7 @@ SRCS= kdump.c ioctl.c subr.c setemul.c .PATH: ${.CURDIR}/../ktrace LDSTATIC?=-static CLEANFILES+=ioctl.c - +WFORMAT=1 .include "Makefile.ioctl-c" .include <bsd.prog.mk> diff --git a/usr.bin/ktruss/Makefile b/usr.bin/ktruss/Makefile index 3b9627d2fa4..5ba349cf0a4 100644 --- a/usr.bin/ktruss/Makefile +++ b/usr.bin/ktruss/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.4 2000/04/10 09:42:37 jdolecek Exp $ +# $NetBSD: Makefile,v 1.5 2000/10/11 14:46:05 is Exp $ PROG= ktruss SRCS= ktrace.c dump.c subr.c ioctl.c misc.c setemul.c @@ -7,7 +7,7 @@ CPPFLAGS+= -I. -I${.CURDIR}/../ktrace -I${.CURDIR}/../../sys \ LDSTATIC?= -static CLEANFILES+= misc.c misc.h ioctl.c MAN= - +WFORMAT=1 dump.c: misc.h misc.c misc.h: ${DESTDIR}/usr/include/sys/errno.h \ ${DESTDIR}/usr/include/sys/signal.h diff --git a/usr.bin/lam/Makefile b/usr.bin/lam/Makefile index 7de33c17ac7..e51b6790c86 100644 --- a/usr.bin/lam/Makefile +++ b/usr.bin/lam/Makefile @@ -1,6 +1,6 @@ -# $NetBSD: Makefile,v 1.2 1994/11/14 20:27:39 jtc Exp $ +# $NetBSD: Makefile,v 1.3 2000/10/11 14:46:05 is Exp $ # @(#)Makefile 8.1 (Berkeley) 6/6/93 PROG= lam - +WFORMAT=1 .include <bsd.prog.mk> diff --git a/usr.bin/less/less/Makefile b/usr.bin/less/less/Makefile index 24a39651a6a..8b7f3321abd 100644 --- a/usr.bin/less/less/Makefile +++ b/usr.bin/less/less/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.7 1997/10/24 09:00:37 lukem Exp $ +# $NetBSD: Makefile,v 1.8 2000/10/11 14:46:09 is Exp $ # from: @(#)Makefile 5.6 (Berkeley) 3/12/91 PROG= less @@ -12,5 +12,6 @@ LDADD+= -ltermcap DPADD+= ${LIBTERM} MLINKS= less.1 more.1 less.1 page.1 LINKS= ${BINDIR}/less ${BINDIR}/more ${BINDIR}/less ${BINDIR}/page +WFORMAT=1 .include <bsd.prog.mk> diff --git a/usr.bin/lex/Makefile b/usr.bin/lex/Makefile index 689bbc5c8ad..b8489c92070 100644 --- a/usr.bin/lex/Makefile +++ b/usr.bin/lex/Makefile @@ -1,5 +1,5 @@ # from: @(#)Makefile 5.4 (Berkeley) 6/24/90 -# $NetBSD: Makefile,v 1.19 1998/04/09 00:32:37 tv Exp $ +# $NetBSD: Makefile,v 1.20 2000/10/11 14:46:10 is Exp $ # # By default, flex will be configured to generate 8-bit scanners only if the # -8 flag is given. If you want it to always generate 8-bit scanners, add @@ -21,7 +21,7 @@ YHEADER=1 CLEANFILES+=scan.c skel.c LDADD= -ll DPADD= ${LIBL} - +WFORMAT= 1 INCS =FlexLexer.h INCSDIR=/usr/include/g++ diff --git a/usr.bin/lex/main.c b/usr.bin/lex/main.c index bb96aeb7ba1..cbe4275629a 100644 --- a/usr.bin/lex/main.c +++ b/usr.bin/lex/main.c @@ -32,7 +32,7 @@ char copyright[] = All rights reserved.\n"; #endif /* not lint */ -/* $NetBSD: main.c,v 1.12 1998/02/22 12:08:35 christos Exp $ */ +/* $NetBSD: main.c,v 1.13 2000/10/11 14:46:10 is Exp $ */ #include "flexdef.h" @@ -109,11 +109,11 @@ int num_input_files; char *program_name = "flex"; #ifndef SHORT_FILE_NAMES -static char *outfile_template = "lex.%s.%s"; -static char *backing_name = "lex.backup"; +static const char outfile_template[] = "lex.%s.%s"; +static const char backing_name[] = "lex.backup"; #else -static char *outfile_template = "lex%s.%s"; -static char *backing_name = "lex.bck"; +static const char outfile_template[] = "lex%s.%s"; +static const char backing_name[] = "lex.bck"; #endif #ifdef THINK_C diff --git a/usr.bin/lex/misc.c b/usr.bin/lex/misc.c index 375de5c589a..2300932b750 100644 --- a/usr.bin/lex/misc.c +++ b/usr.bin/lex/misc.c @@ -26,7 +26,7 @@ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -/* $NetBSD: misc.c,v 1.10 2000/03/13 23:22:51 soren Exp $ */ +/* $NetBSD: misc.c,v 1.11 2000/10/11 14:46:11 is Exp $ */ #include "flexdef.h" @@ -387,7 +387,7 @@ int do_infile; { char directive[MAXLINE], filename[MAXLINE]; char *s1, *s2, *s3; - static char line_fmt[] = "#line %d \"%s\"\n"; + static const char line_fmt[] = "#line %d \"%s\"\n"; if ( ! gen_line_dirs ) return; diff --git a/usr.bin/m4/Makefile b/usr.bin/m4/Makefile index ffbc54beed2..fc28162a136 100644 --- a/usr.bin/m4/Makefile +++ b/usr.bin/m4/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.8 1998/09/01 03:16:48 enami Exp $ +# $NetBSD: Makefile,v 1.9 2000/10/11 14:46:11 is Exp $ # # @(#)Makefile 8.1 (Berkeley) 6/6/93 @@ -9,5 +9,4 @@ PROG= m4 CPPFLAGS+=-DEXTENDED -Dunix SRCS= eval.c expr.c look.c main.c misc.c MAN= m4.1 - .include <bsd.prog.mk> diff --git a/usr.bin/m4/eval.c b/usr.bin/m4/eval.c index fa11c3e6988..d7d8881b0d6 100644 --- a/usr.bin/m4/eval.c +++ b/usr.bin/m4/eval.c @@ -1,4 +1,4 @@ -/* $NetBSD: eval.c,v 1.11 1999/04/20 08:05:51 mrg Exp $ */ +/* $NetBSD: eval.c,v 1.12 2000/10/11 14:46:11 is Exp $ */ /* * Copyright (c) 1989, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)eval.c 8.2 (Berkeley) 4/27/95"; #else -__RCSID("$NetBSD: eval.c,v 1.11 1999/04/20 08:05:51 mrg Exp $"); +__RCSID("$NetBSD: eval.c,v 1.12 2000/10/11 14:46:11 is Exp $"); #endif #endif /* not lint */ @@ -384,7 +384,7 @@ eval(argv, argc, td) } } -char *dumpfmt = "`%s'\t`%s'\n"; /* format string for dumpdef */ +const char dumpfmt[] = "`%s'\t`%s'\n"; /* format string for dumpdef */ /* * expand - user-defined macro expansion diff --git a/usr.bin/make/Makefile b/usr.bin/make/Makefile index c63bab67512..897e75f21ce 100644 --- a/usr.bin/make/Makefile +++ b/usr.bin/make/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.20 1999/08/04 16:44:07 ross Exp $ +# $NetBSD: Makefile,v 1.21 2000/10/11 14:46:12 is Exp $ # @(#)Makefile 5.2 (Berkeley) 12/28/90 CPPFLAGS+= -I${.CURDIR} @@ -11,7 +11,7 @@ SRCS+= lstAppend.c lstAtEnd.c lstAtFront.c lstClose.c lstConcat.c \ lstInit.c lstInsert.c lstIsAtEnd.c lstIsEmpty.c lstLast.c \ lstMember.c lstNext.c lstOpen.c lstRemove.c lstReplace.c lstSucc.c .PATH: ${.CURDIR}/lst.lib - +WFORMAT= 1 .if make(install) SUBDIR= PSD.doc .endif diff --git a/usr.bin/make/nonints.h b/usr.bin/make/nonints.h index b7990080d1f..e587beefc79 100644 --- a/usr.bin/make/nonints.h +++ b/usr.bin/make/nonints.h @@ -1,4 +1,4 @@ -/* $NetBSD: nonints.h,v 1.18 1999/09/15 10:47:44 mycroft Exp $ */ +/* $NetBSD: nonints.h,v 1.19 2000/10/11 14:46:12 is Exp $ */ /*- * Copyright (c) 1988, 1989, 1990, 1993 @@ -68,9 +68,9 @@ void For_Run __P((void)); void Main_ParseArgLine __P((char *)); int main __P((int, char **)); char *Cmd_Exec __P((char *, char **)); -void Error __P((char *, ...)); -void Fatal __P((char *, ...)); -void Punt __P((char *, ...)); +void Error __P((char *, ...)) __attribute__((__format__(__printf__, 1, 2))); +void Fatal __P((char *, ...)) __attribute__((__format__(__printf__, 1, 2))); +void Punt __P((char *, ...)) __attribute__((__format__(__printf__, 1, 2))); void DieHorribly __P((void)); int PrintAddr __P((ClientData, ClientData)); void Finish __P((int)); @@ -81,7 +81,8 @@ void enomem __P((void)); int eunlink __P((const char *)); /* parse.c */ -void Parse_Error __P((int, char *, ...)); +void Parse_Error __P((int, char *, ...)) + __attribute__((__format__(__printf__, 2, 3))); Boolean Parse_AnyExport __P((void)); Boolean Parse_IsVar __P((char *)); void Parse_DoVar __P((char *, GNode *)); diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c index 61f315f718d..5c3751fd6a5 100644 --- a/usr.bin/make/parse.c +++ b/usr.bin/make/parse.c @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.52 2000/06/11 07:39:53 mycroft Exp $ */ +/* $NetBSD: parse.c,v 1.53 2000/10/11 14:46:12 is Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -39,14 +39,14 @@ */ #ifdef MAKE_BOOTSTRAP -static char rcsid[] = "$NetBSD: parse.c,v 1.52 2000/06/11 07:39:53 mycroft Exp $"; +static char rcsid[] = "$NetBSD: parse.c,v 1.53 2000/10/11 14:46:12 is Exp $"; #else #include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: parse.c,v 1.52 2000/06/11 07:39:53 mycroft Exp $"); +__RCSID("$NetBSD: parse.c,v 1.53 2000/10/11 14:46:12 is Exp $"); #endif #endif /* not lint */ #endif @@ -249,8 +249,10 @@ static struct { { ".WAIT", Wait, 0 }, }; -static void ParseErrorInternal __P((char *, size_t, int, char *, ...)); -static void ParseVErrorInternal __P((char *, size_t, int, char *, va_list)); +static void ParseErrorInternal __P((char *, size_t, int, char *, ...)) + __attribute__((__format__(__printf__, 4, 5))); +static void ParseVErrorInternal __P((char *, size_t, int, char *, va_list)) + __attribute__((__format__(__printf__, 4, 0))); static int ParseFindKeyword __P((char *)); static int ParseLinkSrc __P((ClientData, ClientData)); static int ParseDoOp __P((ClientData, ClientData)); diff --git a/usr.bin/man/Makefile b/usr.bin/man/Makefile index 0849681c1bc..36c97c7393d 100644 --- a/usr.bin/man/Makefile +++ b/usr.bin/man/Makefile @@ -1,8 +1,9 @@ -# $NetBSD: Makefile,v 1.6 1995/09/28 06:05:11 tls Exp $ +# $NetBSD: Makefile,v 1.7 2000/10/11 14:46:13 is Exp $ # @(#)Makefile 8.1 (Berkeley) 6/6/93 PROG= man SRCS= config.c man.c MAN= man.1 man.conf.5 +WFORMAT=1 .include <bsd.prog.mk> diff --git a/usr.bin/menuc/defs.h b/usr.bin/menuc/defs.h index ff40285434e..bcc1dbbc874 100644 --- a/usr.bin/menuc/defs.h +++ b/usr.bin/menuc/defs.h @@ -1,4 +1,4 @@ -/* $NetBSD: defs.h,v 1.3 1998/07/01 07:46:02 phil Exp $ */ +/* $NetBSD: defs.h,v 1.4 2000/10/11 14:46:13 is Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -76,7 +76,8 @@ EXTERN action error_act INIT({NULL}); /* Prototypes. */ /* From util.c */ -void yyerror (const char *, ...); +void yyerror (const char *, ...) + __attribute__((__format__(__printf__, 1, 2))); void buff_add_ch (char); char *buff_copy (void); diff --git a/usr.bin/mkstr/mkstr.c b/usr.bin/mkstr/mkstr.c index 638a852cdbd..8bf51083b43 100644 --- a/usr.bin/mkstr/mkstr.c +++ b/usr.bin/mkstr/mkstr.c @@ -1,4 +1,4 @@ -/* $NetBSD: mkstr.c,v 1.8 1997/10/19 14:12:34 mrg Exp $ */ +/* $NetBSD: mkstr.c,v 1.9 2000/10/11 14:46:13 is Exp $ */ /* * Copyright (c) 1980, 1993 @@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\ #if 0 static char sccsid[] = "@(#)mkstr.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: mkstr.c,v 1.8 1997/10/19 14:12:34 mrg Exp $"); +__RCSID("$NetBSD: mkstr.c,v 1.9 2000/10/11 14:46:13 is Exp $"); #endif #endif /* not lint */ @@ -82,7 +82,7 @@ __RCSID("$NetBSD: mkstr.c,v 1.8 1997/10/19 14:12:34 mrg Exp $"); FILE *mesgread, *mesgwrite; char *progname; -char usagestr[] = "usage: %s [ - ] mesgfile prefix file ...\n"; +const char usagestr[] = "usage: %s [ - ] mesgfile prefix file ...\n"; char name[100], *np; void process __P((void)); diff --git a/usr.bin/netstat/atalk.c b/usr.bin/netstat/atalk.c index 1f281d6e520..5d9dd0d36d0 100644 --- a/usr.bin/netstat/atalk.c +++ b/usr.bin/netstat/atalk.c @@ -1,4 +1,4 @@ -/* $NetBSD: atalk.c,v 1.5 1999/01/06 05:57:29 abs Exp $ */ +/* $NetBSD: atalk.c,v 1.6 2000/10/11 14:46:14 is Exp $ */ /* * Copyright (c) 1983, 1988, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "from @(#)atalk.c 1.1 (Whistle) 6/6/96"; #else -__RCSID("$NetBSD: atalk.c,v 1.5 1999/01/06 05:57:29 abs Exp $"); +__RCSID("$NetBSD: atalk.c,v 1.6 2000/10/11 14:46:14 is Exp $"); #endif #endif /* not lint */ @@ -238,7 +238,7 @@ atalkprotopr(off, name) struct ddpcb cb; struct ddpcb *prev, *next; struct ddpcb *initial; - + int width = 22; if (off == 0) return; if (kread(off, (char *)&initial, sizeof(struct ddpcb *)) < 0) @@ -264,23 +264,24 @@ atalkprotopr(off, name) if (aflag) printf(" (including servers)"); putchar('\n'); - if (Aflag) + if (Aflag) { + width = 18; printf("%-8.8s ", "PCB"); - printf(Aflag ? - "%-5.5s %-6.6s %-6.6s %-18.18s %-18.18s %s\n" : - "%-5.5s %-6.6s %-6.6s %-22.22s %-22.22s %s\n", + } + printf("%-5.5s %-6.6s %-6.6s %*.*s %*.*s %s\n", "Proto", "Recv-Q", "Send-Q", - "Local Address", "Foreign Address", "(state)"); + -width, width, "Local Address", + -width, width, "Foreign Address", "(state)"); first = 0; } if (Aflag) printf("%8lx ", ppcb); printf("%-5.5s %6ld %6ld ", name, sockb.so_rcv.sb_cc, sockb.so_snd.sb_cc); - printf(Aflag ? " %-18.18s" : " %-22.22s", atalk_print( - (struct sockaddr *)&ddpcb.ddp_lsat, 7)); - printf(Aflag ? " %-18.18s" : " %-22.22s", atalk_print( - (struct sockaddr *)&ddpcb.ddp_fsat, 7)); + printf(" %*.*s", -width, width, + atalk_print((struct sockaddr *)&ddpcb.ddp_lsat, 7)); + printf(" %*.*s", -width, width, + atalk_print((struct sockaddr *)&ddpcb.ddp_fsat, 7)); putchar('\n'); } } diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c index ded6ffe51d0..bc7b72cd04b 100644 --- a/usr.bin/netstat/if.c +++ b/usr.bin/netstat/if.c @@ -1,4 +1,4 @@ -/* $NetBSD: if.c,v 1.44 2000/07/06 12:40:19 itojun Exp $ */ +/* $NetBSD: if.c,v 1.45 2000/10/11 14:46:14 is Exp $ */ /* * Copyright (c) 1983, 1988, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "from: @(#)if.c 8.2 (Berkeley) 2/21/94"; #else -__RCSID("$NetBSD: if.c,v 1.44 2000/07/06 12:40:19 itojun Exp $"); +__RCSID("$NetBSD: if.c,v 1.45 2000/10/11 14:46:14 is Exp $"); #endif #endif /* not lint */ @@ -182,7 +182,7 @@ intpr(interval, ifnetaddr, pfunc) printf("%-17.17s ", "none"); } else { char hexsep = '.'; /* for hexprint */ - const char *hexfmt = "%x%c"; /* for hexprint */ + const char hexfmt[] = "%02x%c"; /* for hexprint */ if (kread(ifaddraddr, (char *)&ifaddr, sizeof ifaddr)) { ifaddraddr = 0; continue; @@ -341,7 +341,7 @@ intpr(interval, ifnetaddr, pfunc) cp = (char *)LLADDR(sdl); if (sdl->sdl_type == IFT_FDDI || sdl->sdl_type == IFT_ETHER) - hexsep = ':', hexfmt = "%02x%c"; + hexsep = ':'; n = sdl->sdl_alen; } m = printf("%-13.13s ", "<Link>"); diff --git a/usr.bin/netstat/inet6.c b/usr.bin/netstat/inet6.c index ef9b392b552..3673bce0f19 100644 --- a/usr.bin/netstat/inet6.c +++ b/usr.bin/netstat/inet6.c @@ -1,4 +1,4 @@ -/* $NetBSD: inet6.c,v 1.12 2000/08/13 18:41:38 jhawk Exp $ */ +/* $NetBSD: inet6.c,v 1.13 2000/10/11 14:46:14 is Exp $ */ /* BSDI inet.c,v 2.3 1995/10/24 02:19:29 prb Exp */ /* @@ -68,7 +68,7 @@ #if 0 static char sccsid[] = "@(#)inet.c 8.4 (Berkeley) 4/20/94"; #else -__RCSID("$NetBSD: inet6.c,v 1.12 2000/08/13 18:41:38 jhawk Exp $"); +__RCSID("$NetBSD: inet6.c,v 1.13 2000/10/11 14:46:14 is Exp $"); #endif #endif /* not lint */ @@ -157,7 +157,7 @@ ip6protopr(off, name) register struct in6pcb *prev, *next; int istcp; static int first = 1; - + int width = 22; if (off == 0) return; istcp = strcmp(name, "tcp6") == 0; @@ -192,13 +192,15 @@ ip6protopr(off, name) if (aflag) printf(" (including servers)"); putchar('\n'); - if (Aflag) + if (Aflag) { printf("%-8.8s ", "PCB"); - printf(Aflag ? - "%-5.5s %-6.6s %-6.6s %-18.18s %-18.18s %s\n" : - "%-5.5s %-6.6s %-6.6s %-22.22s %-22.22s %s\n", + width = 18; + } + printf( "%-5.5s %-6.6s %-6.6s %*.*s %*.*s %s\n", "Proto", "Recv-Q", "Send-Q", - "Local Address", "Foreign Address", "(state)"); + -width, width, "Local Address", + -width, width, "Foreign Address", + "(state)"); first = 0; } if (Aflag) { diff --git a/usr.bin/netstat/iso.c b/usr.bin/netstat/iso.c index 426a3cf2dfe..971d932a9a1 100644 --- a/usr.bin/netstat/iso.c +++ b/usr.bin/netstat/iso.c @@ -1,4 +1,4 @@ -/* $NetBSD: iso.c,v 1.19 2000/08/31 06:49:42 jhawk Exp $ */ +/* $NetBSD: iso.c,v 1.20 2000/10/11 14:46:14 is Exp $ */ /* * Copyright (c) 1983, 1988, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "from: @(#)iso.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: iso.c,v 1.19 2000/08/31 06:49:42 jhawk Exp $"); +__RCSID("$NetBSD: iso.c,v 1.20 2000/10/11 14:46:14 is Exp $"); #endif #endif /* not lint */ @@ -276,19 +276,20 @@ iso_protopr1(kern_addr, istp) u_long kern_addr; int istp; { - + int width = 22; if (first) { printf("Active ISO net connections"); if (aflag) printf(" (including servers)"); putchar('\n'); - if (Aflag) + if (Aflag) { + width = 18; printf("%-8.8s ", "PCB"); - printf(Aflag ? - "%-5.5s %-6.6s %-6.6s %-18.18s %-18.18s %s\n" : - "%-5.5s %-6.6s %-6.6s %-22.22s %-22.22s %s\n", + } + printf( "%-5.5s %-6.6s %-6.6s %-*.*s %-*.*s %s\n", "Proto", "Recv-Q", "Send-Q", - "Local Address", "Foreign Address", "(state)"); + width, width, "Local Address", + width, width, "Foreign Address", "(state)"); first = 0; } if (Aflag) diff --git a/usr.bin/netstat/ns.c b/usr.bin/netstat/ns.c index dae3badc2a0..ed97ef84514 100644 --- a/usr.bin/netstat/ns.c +++ b/usr.bin/netstat/ns.c @@ -1,4 +1,4 @@ -/* $NetBSD: ns.c,v 1.11 1998/07/12 03:20:14 mrg Exp $ */ +/* $NetBSD: ns.c,v 1.12 2000/10/11 14:46:14 is Exp $ */ /* * Copyright (c) 1983, 1988, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "from: @(#)ns.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: ns.c,v 1.11 1998/07/12 03:20:14 mrg Exp $"); +__RCSID("$NetBSD: ns.c,v 1.12 2000/10/11 14:46:14 is Exp $"); #endif #endif /* not lint */ @@ -95,7 +95,7 @@ nsprotopr(off, name) struct nspcb cb; struct nspcb *prev, *next; int isspp; - + int width = 22; if (off == 0) return; isspp = strcmp(name, "spp") == 0; @@ -132,21 +132,22 @@ nsprotopr(off, name) if (aflag) printf(" (including servers)"); putchar('\n'); - if (Aflag) + if (Aflag) { printf("%-8.8s ", "PCB"); - printf(Aflag ? - "%-5.5s %-6.6s %-6.6s %-18.18s %-18.18s %s\n" : - "%-5.5s %-6.6s %-6.6s %-22.22s %-22.22s %s\n", - "Proto", "Recv-Q", "Send-Q", - "Local Address", "Foreign Address", "(state)"); + width = 18; + } + printf("%-5.5s %-6.6s %-6.6s %-*.*s %-*.*s %s\n", + "Proto", "Recv-Q", "Send-Q", + width, width, "Local Address", + width, width, "Foreign Address", "(state)"); first = 0; } if (Aflag) printf("%8lx ", ppcb); printf("%-5.5s %6ld %6ld ", name, sockb.so_rcv.sb_cc, sockb.so_snd.sb_cc); - printf(" %-22.22s", ns_prpr(&nspcb.nsp_laddr)); - printf(" %-22.22s", ns_prpr(&nspcb.nsp_faddr)); + printf(" %-*.*s", width, width, ns_prpr(&nspcb.nsp_laddr)); + printf(" %-*.*s", width, width, ns_prpr(&nspcb.nsp_faddr)); if (isspp) { extern char *tcpstates[]; if (sppcb.s_state >= TCP_NSTATES) diff --git a/usr.bin/netstat/route.c b/usr.bin/netstat/route.c index 9c270354bbd..40e8ec2a6e3 100644 --- a/usr.bin/netstat/route.c +++ b/usr.bin/netstat/route.c @@ -1,4 +1,4 @@ -/* $NetBSD: route.c,v 1.49 2000/07/06 12:40:19 itojun Exp $ */ +/* $NetBSD: route.c,v 1.50 2000/10/11 14:46:15 is Exp $ */ /* * Copyright (c) 1983, 1988, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "from: @(#)route.c 8.3 (Berkeley) 3/9/94"; #else -__RCSID("$NetBSD: route.c,v 1.49 2000/07/06 12:40:19 itojun Exp $"); +__RCSID("$NetBSD: route.c,v 1.50 2000/10/11 14:46:15 is Exp $"); #endif #endif /* not lint */ @@ -135,7 +135,7 @@ static void ntreestuff __P((void)); static void np_rtentry __P((struct rt_msghdr *)); static void p_sockaddr __P((const struct sockaddr *, const struct sockaddr *, int, int)); -static void p_flags __P((int, char *)); +static void p_flags __P((int)); static void p_rtentry __P((struct rtentry *)); static void ntreestuff __P((void)); static u_long forgemask __P((u_long)); @@ -410,7 +410,7 @@ np_rtentry(rtm) sa = (struct sockaddr *)(ROUNDUP(sa->sa_len) + (char *)sa); p_sockaddr(sa, NULL, 0, 18); } - p_flags(rtm->rtm_flags & interesting, "%-6.6s "); + p_flags(rtm->rtm_flags & interesting); putchar('\n'); } @@ -544,9 +544,8 @@ p_sockaddr(sa, mask, flags, width) } static void -p_flags(f, format) +p_flags(f) int f; - char *format; { char name[33], *flags; struct bits *p = bits; @@ -555,7 +554,7 @@ p_flags(f, format) if (p->b_mask & f) *flags++ = p->b_val; *flags = '\0'; - printf(format, name); + printf("%-6.6s ", name); } static struct sockaddr *sockcopy __P((struct sockaddr *, @@ -603,7 +602,7 @@ p_rtentry(rt) mask = sockcopy(NULL, &mask_un); p_sockaddr(addr, mask, rt->rt_flags, WID_DST(af)); p_sockaddr(kgetsa(rt->rt_gateway), NULL, RTF_HOST, WID_GW(af)); - p_flags(rt->rt_flags, "%-6.6s "); + p_flags(rt->rt_flags); printf("%6d %8lu ", rt->rt_refcnt, rt->rt_use); if (rt->rt_rmx.rmx_mtu) printf("%6lu", rt->rt_rmx.rmx_mtu); diff --git a/usr.bin/nl/Makefile b/usr.bin/nl/Makefile index 41e802745fe..218bbb54234 100644 --- a/usr.bin/nl/Makefile +++ b/usr.bin/nl/Makefile @@ -1,5 +1,5 @@ -# $NetBSD: Makefile,v 1.1 1999/02/15 15:07:15 kleink Exp $ +# $NetBSD: Makefile,v 1.2 2000/10/11 14:46:15 is Exp $ PROG= nl - +WFORMAT= 1 .include <bsd.prog.mk> diff --git a/usr.bin/patch/Makefile b/usr.bin/patch/Makefile index dc204fc1507..c53bddb9d9c 100644 --- a/usr.bin/patch/Makefile +++ b/usr.bin/patch/Makefile @@ -1,6 +1,7 @@ -# $NetBSD: Makefile,v 1.5 1998/02/22 13:33:48 christos Exp $ +# $NetBSD: Makefile,v 1.6 2000/10/11 14:46:15 is Exp $ PROG= patch SRCS= patch.c pch.c inp.c version.c util.c backupfile.c +CFLAGS+= -DCANVARARG .include <bsd.prog.mk> diff --git a/usr.bin/patch/util.c b/usr.bin/patch/util.c index 5c15ffcc3c7..df1214f9522 100644 --- a/usr.bin/patch/util.c +++ b/usr.bin/patch/util.c @@ -1,7 +1,7 @@ -/* $NetBSD: util.c,v 1.7 1999/02/09 05:15:45 sommerfe Exp $ */ +/* $NetBSD: util.c,v 1.8 2000/10/11 14:46:15 is Exp $ */ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: util.c,v 1.7 1999/02/09 05:15:45 sommerfe Exp $"); +__RCSID("$NetBSD: util.c,v 1.8 2000/10/11 14:46:15 is Exp $"); #endif /* not lint */ #include "EXTERN.h" @@ -335,7 +335,7 @@ ask(va_alist) else buf[r] = '\0'; if (!tty2) - say1(buf); + say2("%s",buf); } #endif /* lint */ diff --git a/usr.bin/patch/util.h b/usr.bin/patch/util.h index 054d8329ebe..4a2ec4c2e71 100644 --- a/usr.bin/patch/util.h +++ b/usr.bin/patch/util.h @@ -1,4 +1,4 @@ -/* $NetBSD: util.h,v 1.4 1998/02/22 13:33:50 christos Exp $ */ +/* $NetBSD: util.h,v 1.5 2000/10/11 14:46:15 is Exp $ */ /* and for those machine that can't handle a variable argument list */ @@ -71,10 +71,14 @@ EXT char serrbuf[BUFSIZ]; /* buffer for stderr */ int move_file __P((char *, char *)); void copy_file __P((char *, char *)); char *savestr __P((Reg1 char *)); -void say __P((const char *, ...)); -void fatal __P((const char *, ...)); -void pfatal __P((const char *, ...)); -void ask __P((const char *, ...)); +void say __P((const char *, ...)) + __attribute__((__format__(__printf__, 1, 2))); +void fatal __P((const char *, ...)) + __attribute__((__format__(__printf__, 1, 2))); +void pfatal __P((const char *, ...)) + __attribute__((__format__(__printf__, 1, 2))); +void ask __P((const char *, ...)) + __attribute__((__format__(__printf__, 1, 2))); void set_signals __P((int)); void ignore_signals __P((void)); void makedirs __P((Reg1 char *, bool)); diff --git a/usr.bin/printf/Makefile b/usr.bin/printf/Makefile index 47c3bd07a75..ead77fdb70b 100644 --- a/usr.bin/printf/Makefile +++ b/usr.bin/printf/Makefile @@ -1,6 +1,7 @@ -# $NetBSD: Makefile,v 1.6 1997/11/08 09:34:23 lukem Exp $ +# $NetBSD: Makefile,v 1.7 2000/10/11 14:46:16 is Exp $ # from: @(#)Makefile 8.1 (Berkeley) 6/6/93 PROG= printf +WFORMAT=1 # hopeless! .include <bsd.prog.mk> diff --git a/usr.bin/rdist/defs.h b/usr.bin/rdist/defs.h index 78b4bc09d62..6f37cd7ee3e 100644 --- a/usr.bin/rdist/defs.h +++ b/usr.bin/rdist/defs.h @@ -1,4 +1,4 @@ -/* $NetBSD: defs.h,v 1.12 1998/12/19 20:32:17 christos Exp $ */ +/* $NetBSD: defs.h,v 1.13 2000/10/11 14:46:16 is Exp $ */ /* * Copyright (c) 1983, 1993 @@ -158,17 +158,20 @@ char *colon __P((char *)); void cleanup __P((int)); void define __P((char *)); void docmds __P((char **, int, char **)); -void error __P((const char *, ...)); +void error __P((const char *, ...)) + __attribute__((__format__(__printf__, 1, 2))) ; int except __P((char *)); struct namelist * expand __P((struct namelist *, int)); char *exptilde __P((char [], char *)); -void fatal __P((const char *, ...)); +void fatal __P((const char *, ...)) + __attribute__((__format__(__printf__, 1, 2))); int inlist __P((struct namelist *, char *)); void insert __P((char *, struct namelist *, struct namelist *, struct subcmd *)); void install __P((char *, char *, int, int)); -void log __P((FILE *, const char *, ...)); +void log __P((FILE *, const char *, ...)) + __attribute__((__format__(__printf__, 2, 3))); struct namelist * lookup __P((char *, int, struct namelist *)); void lostconn __P((int)); diff --git a/usr.bin/rdist/server.c b/usr.bin/rdist/server.c index 45387dc44c0..20652b4e2e0 100644 --- a/usr.bin/rdist/server.c +++ b/usr.bin/rdist/server.c @@ -1,4 +1,4 @@ -/* $NetBSD: server.c,v 1.18 1999/04/20 07:53:02 mrg Exp $ */ +/* $NetBSD: server.c,v 1.19 2000/10/11 14:46:16 is Exp $ */ /* * Copyright (c) 1983, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)server.c 8.1 (Berkeley) 6/9/93"; #else -__RCSID("$NetBSD: server.c,v 1.18 1999/04/20 07:53:02 mrg Exp $"); +__RCSID("$NetBSD: server.c,v 1.19 2000/10/11 14:46:16 is Exp $"); #endif #endif /* not lint */ @@ -72,7 +72,8 @@ static void comment __P((char *)); static void dospecial __P((char *)); static int fchtogm __P((int, char *, time_t, char *, char *, mode_t)); static void hardlink __P((char *)); -static void note __P((const char *, ...)); +static void note __P((const char *, ...)) + __attribute__((__format__(__printf__, 1, 2))); static void query __P((char *)); static void recvf __P((char *, int)); static void removeit __P((struct stat *)); diff --git a/usr.bin/rpcgen/rpc_cout.c b/usr.bin/rpcgen/rpc_cout.c index 0a567ebb903..9534f029db2 100644 --- a/usr.bin/rpcgen/rpc_cout.c +++ b/usr.bin/rpcgen/rpc_cout.c @@ -1,4 +1,4 @@ -/* $NetBSD: rpc_cout.c,v 1.16 2000/06/02 23:30:17 fvdl Exp $ */ +/* $NetBSD: rpc_cout.c,v 1.17 2000/10/11 14:46:16 is Exp $ */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for * unrestricted use provided that this legend is included on all tape @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)rpc_cout.c 1.13 89/02/22 (C) 1987 SMI"; #else -__RCSID("$NetBSD: rpc_cout.c,v 1.16 2000/06/02 23:30:17 fvdl Exp $"); +__RCSID("$NetBSD: rpc_cout.c,v 1.17 2000/10/11 14:46:16 is Exp $"); #endif #endif @@ -357,8 +357,8 @@ emit_union(def) case_list *cl; declaration *cs; char *object; - char *vecformat = "objp->%s_u.%s"; - char *format = "&objp->%s_u.%s"; + const char vecformat[] = "objp->%s_u.%s"; + const char format[] = "&objp->%s_u.%s"; f_print(fout, "\n"); print_stat(1, &def->def.un.enum_decl); diff --git a/usr.bin/rpcgen/rpc_hout.c b/usr.bin/rpcgen/rpc_hout.c index 2d17abe336a..f5bd8acfe99 100644 --- a/usr.bin/rpcgen/rpc_hout.c +++ b/usr.bin/rpcgen/rpc_hout.c @@ -1,4 +1,4 @@ -/* $NetBSD: rpc_hout.c,v 1.13 2000/06/07 13:53:07 lukem Exp $ */ +/* $NetBSD: rpc_hout.c,v 1.14 2000/10/11 14:46:17 is Exp $ */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for * unrestricted use provided that this legend is included on all tape @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)rpc_hout.c 1.12 89/02/22 (C) 1987 SMI"; #else -__RCSID("$NetBSD: rpc_hout.c,v 1.13 2000/06/07 13:53:07 lukem Exp $"); +__RCSID("$NetBSD: rpc_hout.c,v 1.14 2000/10/11 14:46:17 is Exp $"); #endif #endif @@ -508,7 +508,7 @@ pdeclaration(name, dec, tab, separator) break; } } - f_print(fout, separator); + f_print(fout, "%s", separator); } static int diff --git a/usr.bin/rpcgen/rpc_main.c b/usr.bin/rpcgen/rpc_main.c index b3df1d9fc53..2a248fca5de 100644 --- a/usr.bin/rpcgen/rpc_main.c +++ b/usr.bin/rpcgen/rpc_main.c @@ -1,4 +1,4 @@ -/* $NetBSD: rpc_main.c,v 1.16 2000/06/02 23:30:18 fvdl Exp $ */ +/* $NetBSD: rpc_main.c,v 1.17 2000/10/11 14:46:17 is Exp $ */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for @@ -35,7 +35,7 @@ #if 0 static char sccsid[] = "@(#)rpc_main.c 1.30 89/03/30 (C) 1987 SMI"; #else -__RCSID("$NetBSD: rpc_main.c,v 1.16 2000/06/02 23:30:18 fvdl Exp $"); +__RCSID("$NetBSD: rpc_main.c,v 1.17 2000/10/11 14:46:17 is Exp $"); #endif #endif @@ -505,7 +505,7 @@ c_initialize() } -char rpcgen_table_dcl[] = "struct rpcgen_table {\n\ +const char rpcgen_table_dcl[] = "struct rpcgen_table {\n\ char *(*proc)();\n\ xdrproc_t xdr_arg;\n\ unsigned len_arg;\n\ diff --git a/usr.bin/rpcgen/rpc_svcout.c b/usr.bin/rpcgen/rpc_svcout.c index 635bc39554e..72f9e8004c3 100644 --- a/usr.bin/rpcgen/rpc_svcout.c +++ b/usr.bin/rpcgen/rpc_svcout.c @@ -1,4 +1,4 @@ -/* $NetBSD: rpc_svcout.c,v 1.10 1997/10/18 10:54:07 lukem Exp $ */ +/* $NetBSD: rpc_svcout.c,v 1.11 2000/10/11 14:46:17 is Exp $ */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for * unrestricted use provided that this legend is included on all tape @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)rpc_svcout.c 1.29 89/03/30 (C) 1987 SMI"; #else -__RCSID("$NetBSD: rpc_svcout.c,v 1.10 1997/10/18 10:54:07 lukem Exp $"); +__RCSID("$NetBSD: rpc_svcout.c,v 1.11 2000/10/11 14:46:17 is Exp $"); #endif #endif @@ -318,7 +318,8 @@ write_real_program(def) f_print(fout, "("); /* arg name */ if (proc->arg_num > 1) - f_print(fout, proc->args.argname); + f_print(fout, "%s", + proc->args.argname); else ptype(proc->args.decls->decl.prefix, proc->args.decls->decl.type, 0); @@ -440,11 +441,14 @@ write_program(def, storage) f_print(fout, "\tswitch (%s->rq_proc) {\n", RQSTP); if (!nullproc(vp->procs)) { f_print(fout, "\tcase NULLPROC:\n"); - f_print(fout, - Cflag - ? "\t\t(void) svc_sendreply(%s, (xdrproc_t) xdr_void, (char *)NULL);\n" - : "\t\t(void) svc_sendreply(%s, xdr_void, (char *)NULL);\n", - TRANSP); + if (Cflag) { + f_print(fout, + "\t\t(void) svc_sendreply(%s, (xdrproc_t) xdr_void, (char *)NULL);\n", TRANSP); + } else { + f_print(fout, + "\t\t(void) svc_sendreply(%s, xdr_void, (char *)NULL);\n", + TRANSP); + } print_return("\t\t"); f_print(fout, "\n"); } @@ -643,11 +647,11 @@ write_msg_out() f_print(fout, "#ifdef RPC_SVC_FG\n"); if (inetdflag || pmflag) f_print(fout, "\tif (_rpcpmstart)\n"); - f_print(fout, "\t\tsyslog(LOG_ERR, msg);\n"); + f_print(fout, "\t\tsyslog(LOG_ERR, \"%%s\", msg);\n"); f_print(fout, "\telse\n"); f_print(fout, "\t\t(void) fprintf(stderr, \"%%s\\n\", msg);\n"); f_print(fout, "#else\n"); - f_print(fout, "\tsyslog(LOG_ERR, msg);\n"); + f_print(fout, "\tsyslog(LOG_ERR, \"%%s\", msg);\n"); f_print(fout, "#endif\n"); f_print(fout, "}\n"); } diff --git a/usr.bin/rpcgen/rpc_tblout.c b/usr.bin/rpcgen/rpc_tblout.c index cb0481a1166..ab14a28086e 100644 --- a/usr.bin/rpcgen/rpc_tblout.c +++ b/usr.bin/rpcgen/rpc_tblout.c @@ -1,4 +1,4 @@ -/* $NetBSD: rpc_tblout.c,v 1.7 1997/10/18 10:54:11 lukem Exp $ */ +/* $NetBSD: rpc_tblout.c,v 1.8 2000/10/11 14:46:17 is Exp $ */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for * unrestricted use provided that this legend is included on all tape @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)rpc_tblout.c 1.4 89/02/22 (C) 1988 SMI"; #else -__RCSID("$NetBSD: rpc_tblout.c,v 1.7 1997/10/18 10:54:11 lukem Exp $"); +__RCSID("$NetBSD: rpc_tblout.c,v 1.8 2000/10/11 14:46:17 is Exp $"); #endif #endif @@ -54,14 +54,14 @@ __RCSID("$NetBSD: rpc_tblout.c,v 1.7 1997/10/18 10:54:11 lukem Exp $"); static char tabstr[TABCOUNT + 1] = "\t\t\t\t\t"; -static char tbl_hdr[] = "struct rpcgen_table %s_table[] = {\n"; -static char tbl_end[] = "};\n"; +static const char tbl_hdr[] = "struct rpcgen_table %s_table[] = {\n"; +static const char tbl_end[] = "};\n"; -static char null_entry[] = "\t(char *(*)())0,\n\ +static const char null_entry[] = "\t(char *(*)())0,\n\ \t(xdrproc_t)xdr_void,\t\t0,\n\ \t(xdrproc_t)xdr_void,\t\t0,\n"; -static char tbl_nproc[] = "int %s_nproc =\n\tsizeof(%s_table)/sizeof(%s_table[0]);\n\n"; +static const char tbl_nproc[] = "int %s_nproc =\n\tsizeof(%s_table)/sizeof(%s_table[0]);\n\n"; static void write_table __P((definition *)); static void printit __P((char *, char *)); diff --git a/usr.bin/rs/rs.c b/usr.bin/rs/rs.c index 7a739012b34..50ec6c663f8 100644 --- a/usr.bin/rs/rs.c +++ b/usr.bin/rs/rs.c @@ -1,4 +1,4 @@ -/* $NetBSD: rs.c,v 1.5 2000/07/24 11:59:38 ad Exp $ */ +/* $NetBSD: rs.c,v 1.6 2000/10/11 14:46:18 is Exp $ */ /*- * Copyright (c) 1993 @@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1993\n\ #if 0 static char sccsid[] = "@(#)rs.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: rs.c,v 1.5 2000/07/24 11:59:38 ad Exp $"); +__RCSID("$NetBSD: rs.c,v 1.6 2000/10/11 14:46:18 is Exp $"); #endif #endif /* not lint */ @@ -58,6 +58,7 @@ __RCSID("$NetBSD: rs.c,v 1.5 2000/07/24 11:59:38 ad Exp $"); #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <stdarg.h> long flags; #define TRANSPOSE 000001 @@ -96,7 +97,8 @@ int propgutter; char isep = ' ', osep = ' '; int owidth = 80, gutter = 2; -void usage __P((char *, char *)); +void usage __P((char *, ...)) + __attribute__((__format__(__printf__, 1, 2))); void getargs __P((int, char *[])); void getfile __P((void)); int getline __P((void)); @@ -241,10 +243,13 @@ prints(s, col) } void -usage(msg, s) - char *msg, *s; +usage(char *msg, ...) { - warnx(msg, s); + va_list ap; + + va_start(ap, msg); + vwarnx(msg, ap); + va_end(ap); fprintf(stderr, "Usage: rs [ -[csCS][x][kKgGw][N]tTeEnyjhHm ] [ rows [ cols ] ]\n"); exit(1); @@ -429,7 +434,7 @@ getargs(ac, av) case 'w': /* window width, default 80 */ p = getnum(&owidth, p, 0); if (owidth <= 0) - usage("Width must be a positive integer", ""); + usage("Width must be a positive integer"); break; case 'K': /* skip N lines */ flags |= SKIPPRINT; @@ -499,7 +504,7 @@ getargs(ac, av) case 0: break; default: - usage("Too many arguments.", ""); + usage("Too many arguments."); } } diff --git a/usr.bin/sed/extern.h b/usr.bin/sed/extern.h index 11f4caba76c..b0bfbb83503 100644 --- a/usr.bin/sed/extern.h +++ b/usr.bin/sed/extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.5 1997/01/09 20:21:29 tls Exp $ */ +/* $NetBSD: extern.h,v 1.6 2000/10/11 14:46:18 is Exp $ */ /*- * Copyright (c) 1992 Diomidis Spinellis. @@ -37,7 +37,7 @@ * SUCH DAMAGE. * * from: @(#)extern.h 8.1 (Berkeley) 6/6/93 - * $NetBSD: extern.h,v 1.5 1997/01/09 20:21:29 tls Exp $ + * $NetBSD: extern.h,v 1.6 2000/10/11 14:46:18 is Exp $ */ extern struct s_command *prog; @@ -54,7 +54,8 @@ void cfclose __P((struct s_command *, struct s_command *)); void compile __P((void)); void cspace __P((SPACE *, char *, size_t, enum e_spflag)); char *cu_fgets __P((char *, int)); -void err __P((int, const char *, ...)); +void err __P((int, const char *, ...)) + __attribute__((__format__(__printf__, 2, 3))); int mf_fgets __P((SPACE *, enum e_spflag)); void process __P((void)); char *strregerror __P((int, regex_t *)); diff --git a/usr.bin/shlock/shlock.c b/usr.bin/shlock/shlock.c index bfbebb83b70..7b7c3fc98e8 100644 --- a/usr.bin/shlock/shlock.c +++ b/usr.bin/shlock/shlock.c @@ -1,4 +1,4 @@ -/* $NetBSD: shlock.c,v 1.4 1998/12/19 22:14:30 christos Exp $ */ +/* $NetBSD: shlock.c,v 1.5 2000/10/11 14:46:18 is Exp $ */ /* ** Program to produce reliable locks for shell scripts. @@ -55,9 +55,9 @@ int Debug = FALSE; char *Pname; -char *USAGE = "%s: USAGE: shlock -f file -p pid [-d][-u]\n"; -char *E_unlk = "%s: unlink(%s): %s\n"; -char *E_open = "%s: open(%s): %s\n"; +const char USAGE[] = "%s: USAGE: shlock -f file -p pid [-d][-u]\n"; +const char E_unlk[] = "%s: unlink(%s): %s\n"; +const char E_open[] = "%s: open(%s): %s\n"; #define dprintf if (Debug) printf diff --git a/usr.bin/systat/extern.h b/usr.bin/systat/extern.h index 4b88275e121..a456c8c8706 100644 --- a/usr.bin/systat/extern.h +++ b/usr.bin/systat/extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.24 2000/08/25 04:48:56 hubertf Exp $ */ +/* $NetBSD: extern.h,v 1.25 2000/10/11 14:46:18 is Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -94,7 +94,8 @@ void disks_delete(char *); void disks_drives(char *); void display(int); int dkinit(int, gid_t); -void error(const char *, ...); +void error(const char *, ...) + __attribute__((__format__(__printf__, 1, 2))); void fetchbufcache(void); void fetchicmp(void); void fetchiostat(void); diff --git a/usr.bin/tail/extern.h b/usr.bin/tail/extern.h index 8a8a1c96ea3..121f2c180ed 100644 --- a/usr.bin/tail/extern.h +++ b/usr.bin/tail/extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.4 1999/07/21 06:38:49 cgd Exp $ */ +/* $NetBSD: extern.h,v 1.5 2000/10/11 14:46:19 is Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -47,7 +47,8 @@ void reverse __P((FILE *, enum STYLE, long, struct stat *)); int bytes __P((FILE *, off_t)); int lines __P((FILE *, off_t)); -void err __P((int fatal, const char *fmt, ...)); +void err __P((int fatal, const char *fmt, ...)) + __attribute__((__format__(__printf__, 2, 3))); void ierr __P((void)); void oerr __P((void)); diff --git a/usr.bin/tip/tip.c b/usr.bin/tip/tip.c index 1ecacf9d0a4..3da081eb779 100644 --- a/usr.bin/tip/tip.c +++ b/usr.bin/tip/tip.c @@ -1,4 +1,4 @@ -/* $NetBSD: tip.c,v 1.22 1998/12/19 23:00:18 christos Exp $ */ +/* $NetBSD: tip.c,v 1.23 2000/10/11 14:46:19 is Exp $ */ /* * Copyright (c) 1983, 1993 @@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1993\n\ #if 0 static char sccsid[] = "@(#)tip.c 8.1 (Berkeley) 6/6/93"; #endif -__RCSID("$NetBSD: tip.c,v 1.22 1998/12/19 23:00:18 christos Exp $"); +__RCSID("$NetBSD: tip.c,v 1.23 2000/10/11 14:46:19 is Exp $"); #endif /* not lint */ /* @@ -243,7 +243,7 @@ cucommon: * internal data structures (variables) * so, fork one process for local side and one for remote. */ - printf(cumode ? "Connected\r\n" : "\07connected\r\n"); + printf("%s", cumode ? "Connected\r\n" : "\07connected\r\n"); switch (pid = fork()) { default: tipin(); diff --git a/usr.bin/top/display.h b/usr.bin/top/display.h index 8e1d8d48a10..fed88649fc9 100644 --- a/usr.bin/top/display.h +++ b/usr.bin/top/display.h @@ -1,4 +1,4 @@ -/* $NetBSD: display.h,v 1.3 1999/04/12 06:02:26 ross Exp $ */ +/* $NetBSD: display.h,v 1.4 2000/10/11 14:46:19 is Exp $ */ /* constants needed for display.c */ @@ -29,7 +29,8 @@ void i_process __P((int, char *)); void u_process __P((int, char *)); void u_endscreen __P((int)); void display_header __P((int)); -void new_message __P((int, const char *, ...)); +void new_message __P((int, const char *, ...)) + __attribute__((__format__(__printf__, 2, 3))); void clear_message __P((void)); int readline __P((char *, int, int)); char *printable __P((char *)); diff --git a/usr.bin/top/machine/m_netbsd15.c b/usr.bin/top/machine/m_netbsd15.c index f04c71c2c15..b691d208af8 100644 --- a/usr.bin/top/machine/m_netbsd15.c +++ b/usr.bin/top/machine/m_netbsd15.c @@ -1,4 +1,4 @@ -/* $NetBSD: m_netbsd15.c,v 1.7 2000/06/09 07:09:28 enami Exp $ */ +/* $NetBSD: m_netbsd15.c,v 1.8 2000/10/11 14:46:20 is Exp $ */ /* * top - a top users display for Unix @@ -34,7 +34,7 @@ * Simon Burge <simonb@netbsd.org> * * - * $Id: m_netbsd15.c,v 1.7 2000/06/09 07:09:28 enami Exp $ + * $Id: m_netbsd15.c,v 1.8 2000/10/11 14:46:20 is Exp $ */ #include <sys/param.h> @@ -93,13 +93,12 @@ static char header[] = "%5d %-8.8s %3d %4d%7s %5s %-7s%7s %5.2f%% %5.2f%% %.12s" -/* Process state names for the "STATE" column of the display. - * The extra nulls in the string "run" are for adding a slash and - * the processor number when needed. +/* + * Process state names for the "STATE" column of the display. */ char *state_abbrev[] = { - "", "start", "run\0\0\0", "sleep", "stop", "zomb", "dead", "onproc" + "", "start", "run", "sleep", "stop", "zomb", "dead", "cpu" }; static kvm_t *kd; @@ -448,6 +447,7 @@ format_next_process(handle, get_userid) long cputime; double pct; struct handle *hp; + char *statep, state[10]; static char fmt[128]; /* static area where result is built */ /* find and remember the next proc structure */ @@ -481,6 +481,19 @@ format_next_process(handle, get_userid) /* calculate the base for cpu percentages */ pct = pctdouble(pp->p_pctcpu); + statep = state_abbrev[(unsigned)pp->p_stat]; + + /* Add cpu number if appropriate */ + if (pp->p_cpuid != ~(uint64_t)0) { + switch (pp->p_stat) { + case SONPROC: + case SRUN: + snprintf(state, sizeof(state), "%s/%lld", + statep, (long long)pp->p_cpuid); + statep = state; + break; + } + } /* format this entry */ sprintf(fmt, Proc_format, @@ -490,7 +503,7 @@ format_next_process(handle, get_userid) pp->p_nice - NZERO, format_k(pagetok(PROCSIZE(pp))), format_k(pagetok(pp->p_vm_rssize)), - state_abbrev[(unsigned char) pp->p_stat], + statep, format_time(cputime), 100.0 * weighted_cpu(pct, pp), 100.0 * pct, diff --git a/usr.bin/tput/tput.c b/usr.bin/tput/tput.c index 09918a7dac2..d3e1546cb27 100644 --- a/usr.bin/tput/tput.c +++ b/usr.bin/tput/tput.c @@ -1,4 +1,4 @@ -/* $NetBSD: tput.c,v 1.13 2000/07/03 02:51:36 matt Exp $ */ +/* $NetBSD: tput.c,v 1.14 2000/10/11 14:46:20 is Exp $ */ /*- * Copyright (c) 1980, 1988, 1993 @@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1988, 1993\n\ #if 0 static char sccsid[] = "@(#)tput.c 8.3 (Berkeley) 4/28/95"; #endif -__RCSID("$NetBSD: tput.c,v 1.13 2000/07/03 02:51:36 matt Exp $"); +__RCSID("$NetBSD: tput.c,v 1.14 2000/10/11 14:46:20 is Exp $"); #endif /* not lint */ #include <termios.h> @@ -143,11 +143,11 @@ static char ** process(cap, str, argv) char *cap, *str, **argv; { - static char errfew[] = + static const char errfew[] = "not enough arguments (%d) for capability `%s'"; - static char errmany[] = + static const char errmany[] = "too many arguments (%d) for capability `%s'"; - static char erresc[] = + static const char erresc[] = "unknown %% escape `%c' for capability `%s'"; char *cp; int arg_need, arg_rows, arg_cols; diff --git a/usr.bin/tset/tset.c b/usr.bin/tset/tset.c index 9e6dfe8448f..61ffaf44900 100644 --- a/usr.bin/tset/tset.c +++ b/usr.bin/tset/tset.c @@ -1,4 +1,4 @@ -/* $NetBSD: tset.c,v 1.11 2000/06/07 13:18:36 simonb Exp $ */ +/* $NetBSD: tset.c,v 1.12 2000/10/11 14:46:21 is Exp $ */ /*- * Copyright (c) 1980, 1991, 1993 @@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1991, 1993\n\ #if 0 static char sccsid[] = "@(#)tset.c 8.1 (Berkeley) 6/9/93"; #endif -__RCSID("$NetBSD: tset.c,v 1.11 2000/06/07 13:18:36 simonb Exp $"); +__RCSID("$NetBSD: tset.c,v 1.12 2000/10/11 14:46:21 is Exp $"); #endif /* not lint */ #include <sys/types.h> @@ -82,7 +82,7 @@ main(argc, argv) #endif int ch, extended, noinit, noset, quiet, Sflag, sflag, showterm; int usingupper; - char savech, *p, *t, *tcapbuf; + char savech, *p, *q, *t, *tcapbuf; const char *ttype; if (tcgetattr(STDERR_FILENO, &mode) < 0) @@ -237,15 +237,17 @@ main(argc, argv) */ if ((p = getenv("SHELL")) && !strcmp(p + strlen(p) - 3, "csh")) { - p = "set noglob;\nsetenv TERM %s;\nsetenv TERMCAP '"; + p = "set noglob;\nsetenv TERM "; + q = ";\nsetenv TERMCAP '"; t = "';\nunset noglob;\n"; } else { - p = "TERM=%s;\nTERMCAP='"; + p = "TERM="; + q = ";\nTERMCAP='"; t = "';\nexport TERMCAP TERM;\n"; } - (void)printf(p, ttype); + (void)printf("%s%s%s", p, ttype, q); wrtermcap(tcapbuf); - (void)printf(t); + (void)printf("%s", t); } exit(0); diff --git a/usr.bin/vi/common/msg.c b/usr.bin/vi/common/msg.c index b4ce3cffc71..a115a3303f7 100644 --- a/usr.bin/vi/common/msg.c +++ b/usr.bin/vi/common/msg.c @@ -1,4 +1,4 @@ -/* $NetBSD: msg.c,v 1.3 1998/07/26 23:14:40 mycroft Exp $ */ +/* $NetBSD: msg.c,v 1.4 2000/10/11 14:46:21 is Exp $ */ /*- * Copyright (c) 1991, 1993, 1994 @@ -474,7 +474,8 @@ msgq_rpt(sp) *p++ = ' '; tlen += 2; } - len = snprintf(p, MAXNUM, "%lu ", sp->rptlines[cnt]); + len = snprintf(p, MAXNUM, "%lu ", + (long)sp->rptlines[cnt]); p += len; tlen += len; t = msg_cat(sp, diff --git a/usr.bin/vi/ex/ex_print.c b/usr.bin/vi/ex/ex_print.c index 737de2795f1..c9c9ddcf84b 100644 --- a/usr.bin/vi/ex/ex_print.c +++ b/usr.bin/vi/ex/ex_print.c @@ -1,4 +1,4 @@ -/* $NetBSD: ex_print.c,v 1.7 1998/01/09 08:07:57 perry Exp $ */ +/* $NetBSD: ex_print.c,v 1.8 2000/10/11 14:46:21 is Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -124,7 +124,8 @@ ex_print(sp, cmdp, fp, tp, flags) */ if (LF_ISSET(E_C_HASH)) { if (from <= 999999) { - snprintf(buf, sizeof(buf), "%6ld ", from); + snprintf(buf, sizeof(buf), "%6ld ", + (long)from); p = buf; } else p = "TOOBIG "; diff --git a/usr.bin/vi/ex/ex_visual.c b/usr.bin/vi/ex/ex_visual.c index 249797e4ddc..dad02f3658d 100644 --- a/usr.bin/vi/ex/ex_visual.c +++ b/usr.bin/vi/ex/ex_visual.c @@ -1,4 +1,4 @@ -/* $NetBSD: ex_visual.c,v 1.7 1998/01/09 08:08:11 perry Exp $ */ +/* $NetBSD: ex_visual.c,v 1.8 2000/10/11 14:46:22 is Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -83,9 +83,9 @@ ex_visual(sp, cmdp) if (FL_ISSET(cmdp->iflags, E_C_COUNT)) len = snprintf(buf, sizeof(buf), - "%luz%c%lu", sp->lno, pos, cmdp->count); + "%luz%c%lu", (long)sp->lno, pos, cmdp->count); else - len = snprintf(buf, sizeof(buf), "%luz%c", sp->lno, pos); + len = snprintf(buf, sizeof(buf), "%luz%c", (long)sp->lno, pos); (void)v_event_push(sp, NULL, buf, len, CH_NOMAP | CH_QUOTED); /* diff --git a/usr.bin/vi/include/common_extern.h b/usr.bin/vi/include/common_extern.h index 54ae4f35e7f..cf00919246b 100644 --- a/usr.bin/vi/include/common_extern.h +++ b/usr.bin/vi/include/common_extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: common_extern.h,v 1.3 1998/07/26 23:14:40 mycroft Exp $ */ +/* $NetBSD: common_extern.h,v 1.4 2000/10/11 14:46:22 is Exp $ */ #ifndef HAVE_STRSEP char *strsep __P((char **, const char *)); @@ -74,7 +74,8 @@ int mark_end __P((SCR *, EXF *)); int mark_get __P((SCR *, ARG_CHAR_T, MARK *, mtype_t)); int mark_set __P((SCR *, ARG_CHAR_T, MARK *, int)); int mark_insdel __P((SCR *, lnop_t, recno_t)); -void msgq __P((SCR *, mtype_t, const char *, ...)); +void msgq __P((SCR *, mtype_t, const char *, ...)) + __attribute__((__format__(__printf__, 3, 4))); void msgq_str __P((SCR *, mtype_t, const char *, const char *)); void msgq_rpt __P((SCR *)); void msgq_status __P((SCR *, recno_t, u_int)); diff --git a/usr.bin/vi/include/ex_extern.h b/usr.bin/vi/include/ex_extern.h index 761ab14323c..4c3c7be605b 100644 --- a/usr.bin/vi/include/ex_extern.h +++ b/usr.bin/vi/include/ex_extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: ex_extern.h,v 1.3 1999/01/08 06:16:55 abs Exp $ */ +/* $NetBSD: ex_extern.h,v 1.4 2000/10/11 14:46:22 is Exp $ */ int ex __P((SCR **)); int ex_cmd __P((SCR *)); @@ -64,7 +64,8 @@ int ex_pr __P((SCR *, EXCMD *)); int ex_print __P((SCR *, EXCMD *, MARK *, MARK *, u_int32_t)); int ex_ldisplay __P((SCR *, const char *, size_t, size_t, u_int)); int ex_scprint __P((SCR *, MARK *, MARK *)); -int ex_printf __P((SCR *, const char *, ...)); +int ex_printf __P((SCR *, const char *, ...)) + __attribute__((__format__(__printf__, 2, 3))); int ex_puts __P((SCR *, const char *)); int ex_fflush __P((SCR *sp)); int ex_put __P((SCR *, EXCMD *)); diff --git a/usr.bin/w/pr_time.c b/usr.bin/w/pr_time.c index e05edb5cc48..53cc9cb6a8a 100644 --- a/usr.bin/w/pr_time.c +++ b/usr.bin/w/pr_time.c @@ -1,4 +1,4 @@ -/* $NetBSD: pr_time.c,v 1.9 1998/04/02 11:34:23 kleink Exp $ */ +/* $NetBSD: pr_time.c,v 1.10 2000/10/11 14:46:22 is Exp $ */ /*- * Copyright (c) 1990, 1993, 1994 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)pr_time.c 8.2 (Berkeley) 4/4/94"; #else -__RCSID("$NetBSD: pr_time.c,v 1.9 1998/04/02 11:34:23 kleink Exp $"); +__RCSID("$NetBSD: pr_time.c,v 1.10 2000/10/11 14:46:22 is Exp $"); #endif #endif /* not lint */ @@ -102,7 +102,7 @@ pr_idle(idle) /* If idle more than 36 hours, print as a number of days. */ if (idle >= 36 * SECSPERHOUR) - printf(days == 1 ? " %dday " : " %ddays ", days); + printf(" %dday%s ", days, days == 1 ? "" : "s"); /* If idle more than an hour, print as HH:MM. */ else if (idle >= SECSPERHOUR) diff --git a/usr.bin/xlint/lint1/Makefile b/usr.bin/xlint/lint1/Makefile index 514a455fa73..130e016d16c 100644 --- a/usr.bin/xlint/lint1/Makefile +++ b/usr.bin/xlint/lint1/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.11 2000/07/23 22:17:14 mycroft Exp $ +# $NetBSD: Makefile,v 1.12 2000/10/11 14:46:23 is Exp $ PROG= lint1 SRCS= cgram.y scan.l mem1.c mem.c err.c main1.c decl.c tree.c func.c \ @@ -9,7 +9,7 @@ DPADD+= ${LIBL} YHEADER=1 CPPFLAGS+=-I${.CURDIR} -I. LINTFLAGS=-aehpz - +WFORMAT=1 #hopeless BINDIR= /usr/libexec scan.c: cgram.h diff --git a/usr.bin/xlint/lint1/externs1.h b/usr.bin/xlint/lint1/externs1.h index a86969857b8..a2b833d106a 100644 --- a/usr.bin/xlint/lint1/externs1.h +++ b/usr.bin/xlint/lint1/externs1.h @@ -1,4 +1,4 @@ -/* $NetBSD: externs1.h,v 1.9 2000/07/06 01:09:56 christos Exp $ */ +/* $NetBSD: externs1.h,v 1.10 2000/10/11 14:46:23 is Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -119,7 +119,8 @@ extern void error __P((int, ...)); extern void warning __P((int, ...)); extern void message __P((int, ...)); extern int gnuism __P((int, ...)); -extern void lerror __P((const char *, ...)) __attribute__((__noreturn__)); +extern void lerror __P((const char *, ...)) + __attribute__((__noreturn__,__format__(__printf__, 1, 2))); /* * decl.c diff --git a/usr.bin/xlint/lint2/Makefile b/usr.bin/xlint/lint2/Makefile index 3c5f02de040..4ad55ba223d 100644 --- a/usr.bin/xlint/lint2/Makefile +++ b/usr.bin/xlint/lint2/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.6 1999/02/13 02:54:57 lukem Exp $ +# $NetBSD: Makefile,v 1.7 2000/10/11 14:46:23 is Exp $ .PATH: ${.CURDIR}/../lint1 @@ -7,7 +7,7 @@ SRCS= main2.c hash.c read.c mem.c mem2.c chk.c msg.c emit.c emit2.c MKMAN= no CPPFLAGS+=-I${.CURDIR}/../lint1 LINTFLAGS=-abehrz - +WFORMAT=1 # hopeless BINDIR= /usr/libexec .include <bsd.prog.mk> diff --git a/usr.bin/yacc/defs.h b/usr.bin/yacc/defs.h index 971bb4fdcb1..ce53ac2f475 100644 --- a/usr.bin/yacc/defs.h +++ b/usr.bin/yacc/defs.h @@ -1,4 +1,4 @@ -/* $NetBSD: defs.h,v 1.7 1997/07/25 16:46:30 perry Exp $ */ +/* $NetBSD: defs.h,v 1.8 2000/10/11 14:46:24 is Exp $ */ /* * Copyright (c) 1989 The Regents of the University of California. @@ -266,7 +266,6 @@ extern int nvars; extern int ntags; extern char unionized; -extern char line_format[]; extern int start_symbol; extern char **symbol_name; diff --git a/usr.bin/yacc/output.c b/usr.bin/yacc/output.c index 75b727eba76..8d972177a2a 100644 --- a/usr.bin/yacc/output.c +++ b/usr.bin/yacc/output.c @@ -1,4 +1,4 @@ -/* $NetBSD: output.c,v 1.7 2000/06/07 23:54:17 explorer Exp $ */ +/* $NetBSD: output.c,v 1.8 2000/10/11 14:46:24 is Exp $ */ /* * Copyright (c) 1989 The Regents of the University of California. @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)output.c 5.7 (Berkeley) 5/24/93"; #else -__RCSID("$NetBSD: output.c,v 1.7 2000/06/07 23:54:17 explorer Exp $"); +__RCSID("$NetBSD: output.c,v 1.8 2000/10/11 14:46:24 is Exp $"); #endif #endif /* not lint */ @@ -90,6 +90,7 @@ void free_itemsets __P((void)); void free_shifts __P((void)); void free_reductions __P((void)); +static const char line_format[] = "#line %d \"%s\"\n"; void output() diff --git a/usr.bin/yacc/reader.c b/usr.bin/yacc/reader.c index f6ef30eb7cf..b59bc15a081 100644 --- a/usr.bin/yacc/reader.c +++ b/usr.bin/yacc/reader.c @@ -1,4 +1,4 @@ -/* $NetBSD: reader.c,v 1.8 1998/12/19 20:03:49 christos Exp $ */ +/* $NetBSD: reader.c,v 1.9 2000/10/11 14:46:24 is Exp $ */ /* * Copyright (c) 1989 The Regents of the University of California. @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)reader.c 5.7 (Berkeley) 1/20/91"; #else -__RCSID("$NetBSD: reader.c,v 1.8 1998/12/19 20:03:49 christos Exp $"); +__RCSID("$NetBSD: reader.c,v 1.9 2000/10/11 14:46:24 is Exp $"); #endif #endif /* not lint */ @@ -118,7 +118,7 @@ void print_grammar __P((void)); void reader __P((void)); -char line_format[] = "#line %d \"%s\"\n"; +static const char line_format[] = "#line %d \"%s\"\n"; void cachec(c) |
