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
This commit is contained in:
Kris Kennaway 2001-08-19 08:19:37 +00:00
parent c0d8a6bc7b
commit 5979df34a6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=81911
14 changed files with 29 additions and 29 deletions

View File

@ -112,7 +112,7 @@ char * word __P((char *));
int getasciilabel __P((FILE *, struct disklabel *)); int getasciilabel __P((FILE *, struct disklabel *));
int checklabel __P((struct disklabel *)); int checklabel __P((struct disklabel *));
void setbootflag __P((struct disklabel *)); void setbootflag __P((struct disklabel *));
void Warning (char *, ...); void Warning (char *, ...) __printflike(1, 2);
void usage __P((void)); void usage __P((void));
struct disklabel * getvirginlabel __P((void)); struct disklabel * getvirginlabel __P((void));

View File

@ -112,7 +112,7 @@ char * word __P((char *));
int getasciilabel __P((FILE *, struct disklabel *)); int getasciilabel __P((FILE *, struct disklabel *));
int checklabel __P((struct disklabel *)); int checklabel __P((struct disklabel *));
void setbootflag __P((struct disklabel *)); void setbootflag __P((struct disklabel *));
void Warning (char *, ...); void Warning (char *, ...) __printflike(1, 2);
void usage __P((void)); void usage __P((void));
struct disklabel * getvirginlabel __P((void)); struct disklabel * getvirginlabel __P((void));

View File

@ -65,7 +65,7 @@ static int preen = 0;
extern char *__progname; 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 void
setcdevname(cd, pr) setcdevname(cd, pr)

View File

@ -300,7 +300,7 @@ void inodirty __P((void));
struct inostat *inoinfo __P((ino_t inum)); struct inostat *inoinfo __P((ino_t inum));
int linkup __P((ino_t orphan, ino_t parentdir, char *name)); int linkup __P((ino_t orphan, ino_t parentdir, char *name));
int makeentry __P((ino_t parent, ino_t ino, 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 pass1 __P((void));
void pass1b __P((void)); void pass1b __P((void));
int pass1check __P((struct inodesc *)); int pass1check __P((struct inodesc *));
@ -309,10 +309,10 @@ void pass3 __P((void));
void pass4 __P((void)); void pass4 __P((void));
int pass4check __P((struct inodesc *)); int pass4check __P((struct inodesc *));
void pass5 __P((void)); 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 pinode __P((ino_t ino));
void propagate __P((void)); 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 readsb __P((int listerr));
int reply __P((char *question)); int reply __P((char *question));
void rwerror __P((char *mesg, ufs_daddr_t blk)); void rwerror __P((char *mesg, ufs_daddr_t blk));

View File

@ -593,7 +593,7 @@ dofix(idesc, msg)
if (idesc->id_type == DATA) if (idesc->id_type == DATA)
direrror(idesc->id_number, msg); direrror(idesc->id_number, msg);
else else
pwarn(msg); pwarn("%s", msg);
if (preen) { if (preen) {
printf(" (SALVAGED)\n"); printf(" (SALVAGED)\n");
idesc->id_fix = FIX; idesc->id_fix = FIX;

View File

@ -189,7 +189,7 @@ iblock(idesc, ilevel, isize)
(void)sprintf(buf, "PARTIALLY TRUNCATED INODE I=%lu", (void)sprintf(buf, "PARTIALLY TRUNCATED INODE I=%lu",
(u_long)idesc->id_number); (u_long)idesc->id_number);
if (preen) { if (preen) {
pfatal(buf); pfatal("%s", buf);
} else if (dofix(idesc, buf)) { } else if (dofix(idesc, buf)) {
*ap = 0; *ap = 0;
dirty(bp); dirty(bp);

View File

@ -285,7 +285,7 @@ void inodirty __P((void));
struct inostat *inoinfo __P((ino_t inum)); struct inostat *inoinfo __P((ino_t inum));
int linkup __P((ino_t orphan, ino_t parentdir, char *name)); int linkup __P((ino_t orphan, ino_t parentdir, char *name));
int makeentry __P((ino_t parent, ino_t ino, 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 pass1 __P((void));
void pass1b __P((void)); void pass1b __P((void));
int pass1check __P((struct inodesc *)); int pass1check __P((struct inodesc *));
@ -294,10 +294,10 @@ void pass3 __P((void));
void pass4 __P((void)); void pass4 __P((void));
int pass4check __P((struct inodesc *)); int pass4check __P((struct inodesc *));
void pass5 __P((void)); 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 pinode __P((ino_t ino));
void propagate __P((void)); void propagate __P((void));
void pwarn __P((const char *fmt, ...)); void pwarn __P((const char *fmt, ...)) __printflike(1, 2);
int reply __P((char *question)); int reply __P((char *question));
void setinodebuf __P((ino_t)); void setinodebuf __P((ino_t));
int setup __P((char *dev)); int setup __P((char *dev));

View File

@ -569,7 +569,7 @@ dofix(idesc, msg)
if (idesc->id_type == DATA) if (idesc->id_type == DATA)
direrror(idesc->id_number, msg); direrror(idesc->id_number, msg);
else else
pwarn(msg); pwarn("%s", msg);
if (preen) { if (preen) {
printf(" (SALVAGED)\n"); printf(" (SALVAGED)\n");
idesc->id_fix = FIX; idesc->id_fix = FIX;

View File

@ -104,9 +104,9 @@ static const char rcsid[] =
void handle __P((sig_t, ...)); void handle __P((sig_t, ...));
void delset __P((sigset_t *, ...)); void delset __P((sigset_t *, ...));
void stall __P((char *, ...)); void stall __P((const char *, ...)) __printflike(1, 2);
void warning __P((char *, ...)); void warning __P((const char *, ...)) __printflike(1, 2);
void emergency __P((char *, ...)); void emergency __P((const char *, ...)) __printflike(1, 2);
void disaster __P((int)); void disaster __P((int));
void badsys __P((int)); void badsys __P((int));
int runshutdown __P((void)); int runshutdown __P((void));
@ -412,7 +412,7 @@ delset(va_alist)
*/ */
void void
#ifdef __STDC__ #ifdef __STDC__
stall(char *message, ...) stall(const char *message, ...)
#else #else
stall(va_alist) stall(va_alist)
va_dcl va_dcl
@ -420,7 +420,7 @@ stall(va_alist)
{ {
va_list ap; va_list ap;
#ifndef __STDC__ #ifndef __STDC__
char *message; const char *message;
va_start(ap); va_start(ap);
message = va_arg(ap, char *); message = va_arg(ap, char *);
@ -440,7 +440,7 @@ stall(va_alist)
*/ */
void void
#ifdef __STDC__ #ifdef __STDC__
warning(char *message, ...) warning(const char *message, ...)
#else #else
warning(va_alist) warning(va_alist)
va_dcl va_dcl
@ -448,7 +448,7 @@ warning(va_alist)
{ {
va_list ap; va_list ap;
#ifndef __STDC__ #ifndef __STDC__
char *message; const char *message;
va_start(ap); va_start(ap);
message = va_arg(ap, char *); message = va_arg(ap, char *);
@ -466,7 +466,7 @@ warning(va_alist)
*/ */
void void
#ifdef __STDC__ #ifdef __STDC__
emergency(char *message, ...) emergency(const char *message, ...)
#else #else
emergency(va_alist) emergency(va_alist)
va_dcl va_dcl
@ -474,7 +474,7 @@ emergency(va_alist)
{ {
va_list ap; va_list ap;
#ifndef __STDC__ #ifndef __STDC__
char *message; const char *message;
va_start(ap); va_start(ap);
message = va_arg(ap, char *); message = va_arg(ap, char *);

View File

@ -245,7 +245,7 @@ int mountdlockfd;
#ifdef DEBUG #ifdef DEBUG
int debug = 1; int debug = 1;
void SYSLOG __P((int, const char *, ...)); void SYSLOG __P((int, const char *, ...)) __printflike(2, 3);
#define syslog SYSLOG #define syslog SYSLOG
#else #else
int debug = 0; int debug = 0;

View File

@ -84,7 +84,7 @@ struct mntopt mopts[] = {
}; };
#if __STDC__ #if __STDC__
void fatal(const char *fmt, ...); void fatal(const char *fmt, ...) __printflike(1, 2);
#else #else
void fatal(); void fatal();
#endif #endif
@ -562,9 +562,9 @@ main(argc, argv)
} }
#ifdef COMPAT #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 #else
char lmsg[] = "%s: can't read disk label"; const char lmsg[] = "%s: can't read disk label";
#endif #endif
struct disklabel * struct disklabel *

View File

@ -69,13 +69,13 @@ long listfile __P((char *, ino_t, int));
ino_t lowerbnd __P((ino_t)); ino_t lowerbnd __P((ino_t));
void mktempname __P((struct entry *)); void mktempname __P((struct entry *));
void moveentry __P((struct entry *, char *)); void moveentry __P((struct entry *, char *));
void msg __P((const char *, ...)); void msg __P((const char *, ...)) __printflike(1, 2);
char *myname __P((struct entry *)); char *myname __P((struct entry *));
void newnode __P((struct entry *)); void newnode __P((struct entry *));
void newtapebuf __P((long)); void newtapebuf __P((long));
long nodeupdates __P((char *, ino_t, int)); long nodeupdates __P((char *, ino_t, int));
void onintr __P((int)); void onintr __P((int));
void panic __P((const char *, ...)); void panic __P((const char *, ...)) __printflike(1, 2);
void pathcheck __P((char *)); void pathcheck __P((char *));
struct direct *pathsearch __P((const char *)); struct direct *pathsearch __P((const char *));
void printdumpinfo __P((void)); void printdumpinfo __P((void));

View File

@ -131,7 +131,7 @@ void find_dev __P((dev_t));
int get_crashtime __P((void)); int get_crashtime __P((void));
void get_dumpsize __P((void)); void get_dumpsize __P((void));
void kmem_setup __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)); void Lseek __P((int, off_t, int));
int Open __P((const char *, int rw)); int Open __P((const char *, int rw));
int Read __P((int, void *, int)); int Read __P((int, void *, int));

View File

@ -245,7 +245,7 @@ int mountdlockfd;
#ifdef DEBUG #ifdef DEBUG
int debug = 1; int debug = 1;
void SYSLOG __P((int, const char *, ...)); void SYSLOG __P((int, const char *, ...)) __printflike(2, 3);
#define syslog SYSLOG #define syslog SYSLOG
#else #else
int debug = 0; int debug = 0;