diff options
author | Martynas Venckus <martynas@cvs.openbsd.org> | 2011-05-30 18:48:34 +0000 |
---|---|---|
committer | Martynas Venckus <martynas@cvs.openbsd.org> | 2011-05-30 18:48:34 +0000 |
commit | e8e86f50ba5766847341543ad3ae23fd9fb9cdfa (patch) | |
tree | d4494067d9a68b8a12bc70fdce778dc9bbcbd7bc /lib/libc/gen | |
parent | afbe27659d775f2cab2735cdcfa8d42dd7a5029a (diff) |
Make printf-like and scanf-like functions marked as such in llib-lc.ln
and llib-lwrap.ln databases; so that the lint features doing format
strings checks are enabled by default.
Looks good to millert@.
Diffstat (limited to 'lib/libc/gen')
-rw-r--r-- | lib/libc/gen/err.c | 4 | ||||
-rw-r--r-- | lib/libc/gen/errx.c | 4 | ||||
-rw-r--r-- | lib/libc/gen/setproctitle.c | 3 | ||||
-rw-r--r-- | lib/libc/gen/syslog.c | 3 | ||||
-rw-r--r-- | lib/libc/gen/syslog_r.c | 3 | ||||
-rw-r--r-- | lib/libc/gen/warn.c | 4 | ||||
-rw-r--r-- | lib/libc/gen/warnx.c | 4 |
7 files changed, 18 insertions, 7 deletions
diff --git a/lib/libc/gen/err.c b/lib/libc/gen/err.c index 3ee4bbcdc88..ff335938214 100644 --- a/lib/libc/gen/err.c +++ b/lib/libc/gen/err.c @@ -1,4 +1,4 @@ -/* $OpenBSD: err.c,v 1.9 2005/08/08 08:05:33 espie Exp $ */ +/* $OpenBSD: err.c,v 1.10 2011/05/30 18:48:33 martynas Exp $ */ /*- * Copyright (c) 1993 * The Regents of the University of California. All rights reserved. @@ -32,6 +32,7 @@ #include <err.h> #include <stdarg.h> +/* PRINTFLIKE2 */ __dead void _err(int eval, const char *fmt, ...) { @@ -42,5 +43,6 @@ _err(int eval, const char *fmt, ...) va_end(ap); } +/* PRINTFLIKE2 */ __weak_alias(err, _err); diff --git a/lib/libc/gen/errx.c b/lib/libc/gen/errx.c index 964ff8a3940..688e2576c67 100644 --- a/lib/libc/gen/errx.c +++ b/lib/libc/gen/errx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: errx.c,v 1.8 2005/08/08 08:05:34 espie Exp $ */ +/* $OpenBSD: errx.c,v 1.9 2011/05/30 18:48:33 martynas Exp $ */ /*- * Copyright (c) 1993 * The Regents of the University of California. All rights reserved. @@ -32,6 +32,7 @@ #include <err.h> #include <stdarg.h> +/* PRINTFLIKE2 */ __dead void _errx(int eval, const char *fmt, ...) { @@ -42,5 +43,6 @@ _errx(int eval, const char *fmt, ...) va_end(ap); } +/* PRINTFLIKE2 */ __weak_alias(errx, _errx); diff --git a/lib/libc/gen/setproctitle.c b/lib/libc/gen/setproctitle.c index 569c9c146c8..259c31d3507 100644 --- a/lib/libc/gen/setproctitle.c +++ b/lib/libc/gen/setproctitle.c @@ -1,4 +1,4 @@ -/* $OpenBSD: setproctitle.c,v 1.11 2005/08/08 08:05:34 espie Exp $ */ +/* $OpenBSD: setproctitle.c,v 1.12 2011/05/30 18:48:33 martynas Exp $ */ /* * Copyright (c) 1994, 1995 Christopher G. Demetriou * All rights reserved. @@ -44,6 +44,7 @@ extern char *__progname; /* Program name, from crt0. */ +/* PRINTFLIKE1 */ void setproctitle(const char *fmt, ...) { diff --git a/lib/libc/gen/syslog.c b/lib/libc/gen/syslog.c index 46c04a08ddd..e713b64edcf 100644 --- a/lib/libc/gen/syslog.c +++ b/lib/libc/gen/syslog.c @@ -1,4 +1,4 @@ -/* $OpenBSD: syslog.c,v 1.30 2009/11/18 07:43:22 guenther Exp $ */ +/* $OpenBSD: syslog.c,v 1.31 2011/05/30 18:48:33 martynas Exp $ */ /* * Copyright (c) 1983, 1988, 1993 * The Regents of the University of California. All rights reserved. @@ -63,6 +63,7 @@ gettime(char *buf, size_t maxsize) * syslog, vsyslog -- * print message on log file; output is intended for syslogd(8). */ +/* PRINTFLIKE2 */ void syslog(int pri, const char *fmt, ...) { diff --git a/lib/libc/gen/syslog_r.c b/lib/libc/gen/syslog_r.c index 6e38a62d276..2a966a4ba62 100644 --- a/lib/libc/gen/syslog_r.c +++ b/lib/libc/gen/syslog_r.c @@ -1,4 +1,4 @@ -/* $OpenBSD: syslog_r.c,v 1.2 2009/11/21 10:23:31 chl Exp $ */ +/* $OpenBSD: syslog_r.c,v 1.3 2011/05/30 18:48:33 martynas Exp $ */ /* * Copyright (c) 1983, 1988, 1993 * The Regents of the University of California. All rights reserved. @@ -54,6 +54,7 @@ void __vsyslog_r(int pri, struct syslog_data *, size_t (*)(char *, size_t), /* Reentrant version of syslog, i.e. syslog_r() */ +/* PRINTFLIKE3 */ void syslog_r(int pri, struct syslog_data *data, const char *fmt, ...) { diff --git a/lib/libc/gen/warn.c b/lib/libc/gen/warn.c index bbff436f59b..4da071155de 100644 --- a/lib/libc/gen/warn.c +++ b/lib/libc/gen/warn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: warn.c,v 1.8 2005/08/08 08:05:34 espie Exp $ */ +/* $OpenBSD: warn.c,v 1.9 2011/05/30 18:48:33 martynas Exp $ */ /*- * Copyright (c) 1993 * The Regents of the University of California. All rights reserved. @@ -32,6 +32,7 @@ #include <err.h> #include <stdarg.h> +/* PRINTFLIKE1 */ void _warn(const char *fmt, ...) { @@ -42,5 +43,6 @@ _warn(const char *fmt, ...) va_end(ap); } +/* PRINTFLIKE1 */ __weak_alias(warn, _warn); diff --git a/lib/libc/gen/warnx.c b/lib/libc/gen/warnx.c index 42a15778c68..8a94cbd0905 100644 --- a/lib/libc/gen/warnx.c +++ b/lib/libc/gen/warnx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: warnx.c,v 1.7 2005/08/08 08:05:34 espie Exp $ */ +/* $OpenBSD: warnx.c,v 1.8 2011/05/30 18:48:33 martynas Exp $ */ /*- * Copyright (c) 1993 * The Regents of the University of California. All rights reserved. @@ -32,6 +32,7 @@ #include <err.h> #include <stdarg.h> +/* PRINTFLIKE1 */ void _warnx(const char *fmt, ...) { @@ -42,5 +43,6 @@ _warnx(const char *fmt, ...) va_end(ap); } +/* PRINTFLIKE1 */ __weak_alias(warnx, _warnx); |