summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1998-07-13 06:45:23 +0000
committerbde <bde@FreeBSD.org>1998-07-13 06:45:23 +0000
commitbf1a9b4c37da22da57d630c9aa1c79e91d310760 (patch)
treea292d667b70115407503c223922b78d70342669a /include
parent6d974eef922ca8150f05ea068cf2b04efd9d5258 (diff)
downloadFreeBSD-src-bf1a9b4c37da22da57d630c9aa1c79e91d310760.zip
FreeBSD-src-bf1a9b4c37da22da57d630c9aa1c79e91d310760.tar.gz
Added macros __printflike() and __scanflike() to <sys/cdefs.h>.
Use them to `make gcc -Wformat' check formats for all printf-like and scanf-like functions in /usr/src except for the err()/warn() family. err() isn't quite printf-like since its format arg can legitimately be NULL. syslog() isn't quite printf-like, but gcc already accepts %m, even for plain printf() when it shouldn't.
Diffstat (limited to 'include')
-rw-r--r--include/stdio.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/include/stdio.h b/include/stdio.h
index 15cb808..c7db2dd 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)stdio.h 8.5 (Berkeley) 4/29/95
- * $Id: stdio.h,v 1.18 1998/06/14 16:04:20 bde Exp $
+ * $Id: stdio.h,v 1.19 1998/07/08 00:52:40 peter Exp $
*/
#ifndef _STDIO_H_
@@ -293,7 +293,7 @@ __END_DECLS
*/
#if !defined (_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
__BEGIN_DECLS
-int asprintf __P((char **, const char *, ...));
+int asprintf __P((char **, const char *, ...)) __printflike(2, 3);
char *fgetln __P((FILE *, size_t *));
int fpurge __P((FILE *));
int getw __P((FILE *));
@@ -303,11 +303,14 @@ int putw __P((int, FILE *));
void setbuffer __P((FILE *, char *, int));
int setlinebuf __P((FILE *));
char *tempnam __P((const char *, const char *));
-int snprintf __P((char *, size_t, const char *, ...));
-int vasprintf __P((char **, const char *, _BSD_VA_LIST_));
-int vsnprintf __P((char *, size_t, const char *, _BSD_VA_LIST_));
-int vscanf __P((const char *, _BSD_VA_LIST_));
-int vsscanf __P((const char *, const char *, _BSD_VA_LIST_));
+int snprintf __P((char *, size_t, const char *, ...)) __printflike(3, 4);
+int vasprintf __P((char **, const char *, _BSD_VA_LIST_))
+ __printflike(2, 0);
+int vsnprintf __P((char *, size_t, const char *, _BSD_VA_LIST_))
+ __printflike(3, 0);
+int vscanf __P((const char *, _BSD_VA_LIST_)) __scanflike(1, 0);
+int vsscanf __P((const char *, const char *, _BSD_VA_LIST_))
+ __scanflike(2, 0);
__END_DECLS
/*
OpenPOWER on IntegriCloud