summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorkris <kris@FreeBSD.org>2001-04-17 07:46:38 +0000
committerkris <kris@FreeBSD.org>2001-04-17 07:46:38 +0000
commitb6da0fca774d229c4776e41d019373d1ec0df7ab (patch)
tree90405fcc57a8301012105d9d0facc3ded561a0f6 /bin
parent9acb56a18a243e153f49b5fc26f3b3050492b013 (diff)
downloadFreeBSD-src-b6da0fca774d229c4776e41d019373d1ec0df7ab.zip
FreeBSD-src-b6da0fca774d229c4776e41d019373d1ec0df7ab.tar.gz
-Wnon-const-format sweep: make format strings const char *'s, add
__printflike()/__printf0like() to function prototypes, as appropriate. Reviewed by: bde, -audit
Diffstat (limited to 'bin')
-rw-r--r--bin/pax/extern.h6
-rw-r--r--bin/pax/tty_subs.c12
-rw-r--r--bin/rcp/extern.h2
-rw-r--r--bin/rcp/rcp.c3
-rw-r--r--bin/sh/bltin/bltin.h2
-rw-r--r--bin/sh/error.c10
-rw-r--r--bin/sh/error.h4
-rw-r--r--bin/sh/mknodes.c4
-rw-r--r--bin/sh/output.c18
-rw-r--r--bin/sh/output.h10
-rw-r--r--bin/sh/show.h2
11 files changed, 37 insertions, 36 deletions
diff --git a/bin/pax/extern.h b/bin/pax/extern.h
index 5f7625e..ff33e5b 100644
--- a/bin/pax/extern.h
+++ b/bin/pax/extern.h
@@ -279,7 +279,7 @@ int ustar_wr __P((register ARCHD *));
* tty_subs.c
*/
int tty_init __P((void));
-void tty_prnt __P((char *, ...));
+void tty_prnt __P((const char *, ...)) __printflike(1, 2);
int tty_read __P((char *, int));
-void pax_warn __P((int, char *, ...));
-void sys_warn __P((int, int, char *, ...));
+void pax_warn __P((int, const char *, ...)) __printflike(2, 3);
+void sys_warn __P((int, int, const char *, ...)) __printflike(3, 4);
diff --git a/bin/pax/tty_subs.c b/bin/pax/tty_subs.c
index d70bffa..805567c 100644
--- a/bin/pax/tty_subs.c
+++ b/bin/pax/tty_subs.c
@@ -106,11 +106,11 @@ tty_init()
#if __STDC__
void
-tty_prnt(char *fmt, ...)
+tty_prnt(const char *fmt, ...)
#else
void
tty_prnt(fmt, va_alist)
- char *fmt;
+ const char *fmt;
va_dcl
#endif
{
@@ -167,12 +167,12 @@ tty_read(str, len)
#if __STDC__
void
-pax_warn(int set, char *fmt, ...)
+pax_warn(int set, const char *fmt, ...)
#else
void
pax_warn(set, fmt, va_alist)
int set;
- char *fmt;
+ const char *fmt;
va_dcl
#endif
{
@@ -206,13 +206,13 @@ pax_warn(set, fmt, va_alist)
#if __STDC__
void
-sys_warn(int set, int errnum, char *fmt, ...)
+sys_warn(int set, int errnum, const char *fmt, ...)
#else
void
sys_warn(set, errnum, fmt, va_alist)
int set;
int errnum;
- char *fmt;
+ const char *fmt;
va_dcl
#endif
{
diff --git a/bin/rcp/extern.h b/bin/rcp/extern.h
index 5081c9d..06e639b 100644
--- a/bin/rcp/extern.h
+++ b/bin/rcp/extern.h
@@ -46,6 +46,6 @@ char *colon __P((char *));
void lostconn __P((int));
void nospace __P((void));
int okname __P((char *));
-void run_err __P((const char *, ...));
+void run_err __P((const char *, ...)) __printflike(1, 2);
int susystem __P((char *, int));
void verifydir __P((char *));
diff --git a/bin/rcp/rcp.c b/bin/rcp/rcp.c
index a1534ea..8f413bd 100644
--- a/bin/rcp/rcp.c
+++ b/bin/rcp/rcp.c
@@ -106,10 +106,11 @@ char cmd[CMDNEEDS]; /* must hold "rcp -r -p -d\0" */
#ifdef KERBEROS
int kerberos __P((char **, char *, char *, char *));
-void oldw __P((const char *, ...));
+void oldw __P((const char *, ...)) __printflike(1, 2);
#endif
int response __P((void));
void rsource __P((char *, struct stat *));
+void run_err __P((const char *, ...)) __printflike(1, 2);
void sink __P((int, char *[]));
void source __P((int, char *[]));
void tolocal __P((int, char *[]));
diff --git a/bin/sh/bltin/bltin.h b/bin/sh/bltin/bltin.h
index a96c476..5d2b02a 100644
--- a/bin/sh/bltin/bltin.h
+++ b/bin/sh/bltin/bltin.h
@@ -85,7 +85,7 @@
#ifdef __STDC__
pointer stalloc(int);
-void error(char *, ...);
+void error(const char *, ...) __printf0like(1, 2);
#else
pointer stalloc();
void error();
diff --git a/bin/sh/error.c b/bin/sh/error.c
index e079699..0407bac 100644
--- a/bin/sh/error.c
+++ b/bin/sh/error.c
@@ -70,7 +70,7 @@ volatile sig_atomic_t intpending;
char *commandname;
-static void exverror __P((int, char *, va_list));
+static void exverror __P((int, const char *, va_list)) __printf0like(2, 0);
/*
* Called to raise an exception. Since C doesn't include exceptions, we
@@ -141,7 +141,7 @@ onint() {
static void
exverror(cond, msg, ap)
int cond;
- char *msg;
+ const char *msg;
va_list ap;
{
CLEAR_PENDING_INT;
@@ -166,7 +166,7 @@ exverror(cond, msg, ap)
#ifdef __STDC__
void
-error(char *msg, ...)
+error(const char *msg, ...)
#else
void
error(va_alist)
@@ -174,7 +174,7 @@ error(va_alist)
#endif
{
#ifndef __STDC__
- char *msg;
+ const char *msg;
#endif
va_list ap;
#ifdef __STDC__
@@ -190,7 +190,7 @@ error(va_alist)
#ifdef __STDC__
void
-exerror(int cond, char *msg, ...)
+exerror(int cond, const char *msg, ...)
#else
void
exerror(va_alist)
diff --git a/bin/sh/error.h b/bin/sh/error.h
index b86e177..938ef91 100644
--- a/bin/sh/error.h
+++ b/bin/sh/error.h
@@ -91,8 +91,8 @@ extern volatile sig_atomic_t intpending;
void exraise __P((int));
void onint __P((void));
-void error __P((char *, ...));
-void exerror __P((int, char *, ...));
+void error __P((const char *, ...)) __printf0like(1, 2);
+void exerror __P((int, const char *, ...)) __printf0like(2, 3);
char *errmsg __P((int, int));
diff --git a/bin/sh/mknodes.c b/bin/sh/mknodes.c
index 007cb32..6fea8ec 100644
--- a/bin/sh/mknodes.c
+++ b/bin/sh/mknodes.c
@@ -112,7 +112,7 @@ static void indent __P((int, FILE *));
static int nextfield __P((char *));
static void skipbl __P((void));
static int readline __P((void));
-static void error __P((const char *, ...));
+static void error __P((const char *, ...)) __printf0like(1, 2);
static char *savestr __P((const char *));
@@ -451,7 +451,7 @@ error(va_alist)
#ifdef __STDC__
va_start(va, msg);
#else
- char *msg;
+ const char *msg;
va_start(va);
msg = va_arg(va, char *);
#endif
diff --git a/bin/sh/output.c b/bin/sh/output.c
index 82ae380..2989c9a 100644
--- a/bin/sh/output.c
+++ b/bin/sh/output.c
@@ -221,7 +221,7 @@ freestdout() {
#ifdef __STDC__
void
-outfmt(struct output *file, char *fmt, ...) {
+outfmt(struct output *file, const char *fmt, ...) {
va_list ap;
va_start(ap, fmt);
@@ -231,7 +231,7 @@ outfmt(struct output *file, char *fmt, ...) {
void
-out1fmt(char *fmt, ...) {
+out1fmt(const char *fmt, ...) {
va_list ap;
va_start(ap, fmt);
@@ -240,7 +240,7 @@ out1fmt(char *fmt, ...) {
}
void
-dprintf(char *fmt, ...) {
+dprintf(const char *fmt, ...) {
va_list ap;
va_start(ap, fmt);
@@ -250,7 +250,7 @@ dprintf(char *fmt, ...) {
}
void
-fmtstr(char *outbuf, int length, char *fmt, ...) {
+fmtstr(char *outbuf, int length, const char *fmt, ...) {
va_list ap;
struct output strout;
@@ -273,7 +273,7 @@ outfmt(va_alist)
{
va_list ap;
struct output *file;
- char *fmt;
+ const char *fmt;
va_start(ap);
file = va_arg(ap, struct output *);
@@ -288,7 +288,7 @@ out1fmt(va_alist)
va_dcl
{
va_list ap;
- char *fmt;
+ const char *fmt;
va_start(ap);
fmt = va_arg(ap, char *);
@@ -301,7 +301,7 @@ dprintf(va_alist)
va_dcl
{
va_list ap;
- char *fmt;
+ const char *fmt;
va_start(ap);
fmt = va_arg(ap, char *);
@@ -318,7 +318,7 @@ fmtstr(va_alist)
struct output strout;
char *outbuf;
int length;
- char *fmt;
+ const char *fmt;
va_start(ap);
outbuf = va_arg(ap, char *);
@@ -357,7 +357,7 @@ static const char digit[] = "0123456789ABCDEF";
void
doformat(dest, f, ap)
struct output *dest;
- char *f; /* format string */
+ const char *f; /* format string */
va_list ap;
{
char c;
diff --git a/bin/sh/output.h b/bin/sh/output.h
index f99db6b..425b49f 100644
--- a/bin/sh/output.h
+++ b/bin/sh/output.h
@@ -68,11 +68,11 @@ void emptyoutbuf __P((struct output *));
void flushall __P((void));
void flushout __P((struct output *));
void freestdout __P((void));
-void outfmt __P((struct output *, char *, ...));
-void out1fmt __P((char *, ...));
-void dprintf __P((char *, ...));
-void fmtstr __P((char *, int, char *, ...));
-void doformat __P((struct output *, char *, va_list));
+void outfmt __P((struct output *, const char *, ...)) __printflike(2, 3);
+void out1fmt __P((const char *, ...)) __printflike(1, 2);
+void dprintf __P((const char *, ...)) __printflike(1, 2);
+void fmtstr __P((char *, int, const char *, ...)) __printflike(3, 4);
+void doformat __P((struct output *, const char *, va_list)) __printflike(2, 0);
int xwrite __P((int, char *, int));
int xioctl __P((int, unsigned long, char *));
diff --git a/bin/sh/show.h b/bin/sh/show.h
index 837d21c..98ec398 100644
--- a/bin/sh/show.h
+++ b/bin/sh/show.h
@@ -36,7 +36,7 @@
void showtree __P((union node *));
#ifdef DEBUG
-void sh_trace __P((const char *, ...));
+void sh_trace __P((const char *, ...)) __printflike(1, 2);
void trargs __P((char **));
void trputc __P((int));
void trputs __P((char *));
OpenPOWER on IntegriCloud