diff options
author | kris <kris@FreeBSD.org> | 2001-08-19 08:19:37 +0000 |
---|---|---|
committer | kris <kris@FreeBSD.org> | 2001-08-19 08:19:37 +0000 |
commit | 5e75b336b9d01ea2b70ff9f4098ca7e54f86975a (patch) | |
tree | c307dda030341761eafafb3d34259ed800c35e94 | |
parent | 0bbccbf2dc9057e56f7233044f08c4b59f4f3e30 (diff) | |
download | FreeBSD-src-5e75b336b9d01ea2b70ff9f4098ca7e54f86975a.zip FreeBSD-src-5e75b336b9d01ea2b70ff9f4098ca7e54f86975a.tar.gz |
Silence non-constant format string warnings by marking functions
as __printflike()/__printf0like(), adding const, or adding missing "%s"
format strings, as appropriate.
MFC after: 2 weeks
-rw-r--r-- | sbin/bsdlabel/bsdlabel.c | 2 | ||||
-rw-r--r-- | sbin/disklabel/disklabel.c | 2 | ||||
-rw-r--r-- | sbin/fsck/fsutil.c | 2 | ||||
-rw-r--r-- | sbin/fsck_ffs/fsck.h | 6 | ||||
-rw-r--r-- | sbin/fsck_ffs/fsutil.c | 2 | ||||
-rw-r--r-- | sbin/fsck_ffs/inode.c | 2 | ||||
-rw-r--r-- | sbin/fsck_ifs/fsck.h | 6 | ||||
-rw-r--r-- | sbin/fsck_ifs/fsutil.c | 2 | ||||
-rw-r--r-- | sbin/init/init.c | 18 | ||||
-rw-r--r-- | sbin/mountd/mountd.c | 2 | ||||
-rw-r--r-- | sbin/newfs/newfs.c | 6 | ||||
-rw-r--r-- | sbin/restore/extern.h | 4 | ||||
-rw-r--r-- | sbin/savecore/savecore.c | 2 | ||||
-rw-r--r-- | usr.sbin/mountd/mountd.c | 2 |
14 files changed, 29 insertions, 29 deletions
diff --git a/sbin/bsdlabel/bsdlabel.c b/sbin/bsdlabel/bsdlabel.c index 7de7a36..5317a66 100644 --- a/sbin/bsdlabel/bsdlabel.c +++ b/sbin/bsdlabel/bsdlabel.c @@ -112,7 +112,7 @@ char * word __P((char *)); int getasciilabel __P((FILE *, struct disklabel *)); int checklabel __P((struct disklabel *)); void setbootflag __P((struct disklabel *)); -void Warning (char *, ...); +void Warning (char *, ...) __printflike(1, 2); void usage __P((void)); struct disklabel * getvirginlabel __P((void)); diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c index 7de7a36..5317a66 100644 --- a/sbin/disklabel/disklabel.c +++ b/sbin/disklabel/disklabel.c @@ -112,7 +112,7 @@ char * word __P((char *)); int getasciilabel __P((FILE *, struct disklabel *)); int checklabel __P((struct disklabel *)); void setbootflag __P((struct disklabel *)); -void Warning (char *, ...); +void Warning (char *, ...) __printflike(1, 2); void usage __P((void)); struct disklabel * getvirginlabel __P((void)); diff --git a/sbin/fsck/fsutil.c b/sbin/fsck/fsutil.c index a7a89aa..0f6140c 100644 --- a/sbin/fsck/fsutil.c +++ b/sbin/fsck/fsutil.c @@ -65,7 +65,7 @@ static int preen = 0; extern char *__progname; -static void vmsg __P((int, const char *, va_list)); +static void vmsg __P((int, const char *, va_list)) __printflike(2, 0); void setcdevname(cd, pr) diff --git a/sbin/fsck_ffs/fsck.h b/sbin/fsck_ffs/fsck.h index 9321560..b316bb9 100644 --- a/sbin/fsck_ffs/fsck.h +++ b/sbin/fsck_ffs/fsck.h @@ -300,7 +300,7 @@ void inodirty __P((void)); struct inostat *inoinfo __P((ino_t inum)); int linkup __P((ino_t orphan, ino_t parentdir, char *name)); int makeentry __P((ino_t parent, ino_t ino, char *name)); -void panic __P((const char *fmt, ...)); +void panic __P((const char *fmt, ...)) __printflike(1, 2); void pass1 __P((void)); void pass1b __P((void)); int pass1check __P((struct inodesc *)); @@ -309,10 +309,10 @@ void pass3 __P((void)); void pass4 __P((void)); int pass4check __P((struct inodesc *)); void pass5 __P((void)); -void pfatal __P((const char *fmt, ...)); +void pfatal __P((const char *fmt, ...)) __printflike(1, 2); void pinode __P((ino_t ino)); void propagate __P((void)); -void pwarn __P((const char *fmt, ...)); +void pwarn __P((const char *fmt, ...)) __printflike(1, 2); int readsb __P((int listerr)); int reply __P((char *question)); void rwerror __P((char *mesg, ufs_daddr_t blk)); diff --git a/sbin/fsck_ffs/fsutil.c b/sbin/fsck_ffs/fsutil.c index 325fe5c..7cbde0c 100644 --- a/sbin/fsck_ffs/fsutil.c +++ b/sbin/fsck_ffs/fsutil.c @@ -593,7 +593,7 @@ dofix(idesc, msg) if (idesc->id_type == DATA) direrror(idesc->id_number, msg); else - pwarn(msg); + pwarn("%s", msg); if (preen) { printf(" (SALVAGED)\n"); idesc->id_fix = FIX; diff --git a/sbin/fsck_ffs/inode.c b/sbin/fsck_ffs/inode.c index 06c2e77..effe73f 100644 --- a/sbin/fsck_ffs/inode.c +++ b/sbin/fsck_ffs/inode.c @@ -189,7 +189,7 @@ iblock(idesc, ilevel, isize) (void)sprintf(buf, "PARTIALLY TRUNCATED INODE I=%lu", (u_long)idesc->id_number); if (preen) { - pfatal(buf); + pfatal("%s", buf); } else if (dofix(idesc, buf)) { *ap = 0; dirty(bp); diff --git a/sbin/fsck_ifs/fsck.h b/sbin/fsck_ifs/fsck.h index a0be2a4..25dbc45 100644 --- a/sbin/fsck_ifs/fsck.h +++ b/sbin/fsck_ifs/fsck.h @@ -285,7 +285,7 @@ void inodirty __P((void)); struct inostat *inoinfo __P((ino_t inum)); int linkup __P((ino_t orphan, ino_t parentdir, char *name)); int makeentry __P((ino_t parent, ino_t ino, char *name)); -void panic __P((const char *fmt, ...)); +void panic __P((const char *fmt, ...)) __printflike(1, 2); void pass1 __P((void)); void pass1b __P((void)); int pass1check __P((struct inodesc *)); @@ -294,10 +294,10 @@ void pass3 __P((void)); void pass4 __P((void)); int pass4check __P((struct inodesc *)); void pass5 __P((void)); -void pfatal __P((const char *fmt, ...)); +void pfatal __P((const char *fmt, ...)) __printflike(1, 2); void pinode __P((ino_t ino)); void propagate __P((void)); -void pwarn __P((const char *fmt, ...)); +void pwarn __P((const char *fmt, ...)) __printflike(1, 2); int reply __P((char *question)); void setinodebuf __P((ino_t)); int setup __P((char *dev)); diff --git a/sbin/fsck_ifs/fsutil.c b/sbin/fsck_ifs/fsutil.c index 2217f3c..c510094 100644 --- a/sbin/fsck_ifs/fsutil.c +++ b/sbin/fsck_ifs/fsutil.c @@ -569,7 +569,7 @@ dofix(idesc, msg) if (idesc->id_type == DATA) direrror(idesc->id_number, msg); else - pwarn(msg); + pwarn("%s", msg); if (preen) { printf(" (SALVAGED)\n"); idesc->id_fix = FIX; diff --git a/sbin/init/init.c b/sbin/init/init.c index 81fe85e..b59f288 100644 --- a/sbin/init/init.c +++ b/sbin/init/init.c @@ -104,9 +104,9 @@ static const char rcsid[] = void handle __P((sig_t, ...)); void delset __P((sigset_t *, ...)); -void stall __P((char *, ...)); -void warning __P((char *, ...)); -void emergency __P((char *, ...)); +void stall __P((const char *, ...)) __printflike(1, 2); +void warning __P((const char *, ...)) __printflike(1, 2); +void emergency __P((const char *, ...)) __printflike(1, 2); void disaster __P((int)); void badsys __P((int)); int runshutdown __P((void)); @@ -412,7 +412,7 @@ delset(va_alist) */ void #ifdef __STDC__ -stall(char *message, ...) +stall(const char *message, ...) #else stall(va_alist) va_dcl @@ -420,7 +420,7 @@ stall(va_alist) { va_list ap; #ifndef __STDC__ - char *message; + const char *message; va_start(ap); message = va_arg(ap, char *); @@ -440,7 +440,7 @@ stall(va_alist) */ void #ifdef __STDC__ -warning(char *message, ...) +warning(const char *message, ...) #else warning(va_alist) va_dcl @@ -448,7 +448,7 @@ warning(va_alist) { va_list ap; #ifndef __STDC__ - char *message; + const char *message; va_start(ap); message = va_arg(ap, char *); @@ -466,7 +466,7 @@ warning(va_alist) */ void #ifdef __STDC__ -emergency(char *message, ...) +emergency(const char *message, ...) #else emergency(va_alist) va_dcl @@ -474,7 +474,7 @@ emergency(va_alist) { va_list ap; #ifndef __STDC__ - char *message; + const char *message; va_start(ap); message = va_arg(ap, char *); diff --git a/sbin/mountd/mountd.c b/sbin/mountd/mountd.c index 2ca85f4..aab4479 100644 --- a/sbin/mountd/mountd.c +++ b/sbin/mountd/mountd.c @@ -245,7 +245,7 @@ int mountdlockfd; #ifdef DEBUG int debug = 1; -void SYSLOG __P((int, const char *, ...)); +void SYSLOG __P((int, const char *, ...)) __printflike(2, 3); #define syslog SYSLOG #else int debug = 0; diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c index cf26619..a133f54 100644 --- a/sbin/newfs/newfs.c +++ b/sbin/newfs/newfs.c @@ -84,7 +84,7 @@ struct mntopt mopts[] = { }; #if __STDC__ -void fatal(const char *fmt, ...); +void fatal(const char *fmt, ...) __printflike(1, 2); #else void fatal(); #endif @@ -562,9 +562,9 @@ main(argc, argv) } #ifdef COMPAT -char lmsg[] = "%s: can't read disk label; disk type must be specified"; +const char lmsg[] = "%s: can't read disk label; disk type must be specified"; #else -char lmsg[] = "%s: can't read disk label"; +const char lmsg[] = "%s: can't read disk label"; #endif struct disklabel * diff --git a/sbin/restore/extern.h b/sbin/restore/extern.h index 05ca742..0724850 100644 --- a/sbin/restore/extern.h +++ b/sbin/restore/extern.h @@ -69,13 +69,13 @@ long listfile __P((char *, ino_t, int)); ino_t lowerbnd __P((ino_t)); void mktempname __P((struct entry *)); void moveentry __P((struct entry *, char *)); -void msg __P((const char *, ...)); +void msg __P((const char *, ...)) __printflike(1, 2); char *myname __P((struct entry *)); void newnode __P((struct entry *)); void newtapebuf __P((long)); long nodeupdates __P((char *, ino_t, int)); void onintr __P((int)); -void panic __P((const char *, ...)); +void panic __P((const char *, ...)) __printflike(1, 2); void pathcheck __P((char *)); struct direct *pathsearch __P((const char *)); void printdumpinfo __P((void)); diff --git a/sbin/savecore/savecore.c b/sbin/savecore/savecore.c index e91ea11..2d33858 100644 --- a/sbin/savecore/savecore.c +++ b/sbin/savecore/savecore.c @@ -131,7 +131,7 @@ void find_dev __P((dev_t)); int get_crashtime __P((void)); void get_dumpsize __P((void)); void kmem_setup __P((void)); -void log __P((int, char *, ...)); +void log __P((int, char *, ...)) __printflike(2, 3); void Lseek __P((int, off_t, int)); int Open __P((const char *, int rw)); int Read __P((int, void *, int)); diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index 2ca85f4..aab4479 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -245,7 +245,7 @@ int mountdlockfd; #ifdef DEBUG int debug = 1; -void SYSLOG __P((int, const char *, ...)); +void SYSLOG __P((int, const char *, ...)) __printflike(2, 3); #define syslog SYSLOG #else int debug = 0; |