Module Name:    src
Committed By:   joerg
Date:           Thu Feb 25 18:37:13 UTC 2010

Modified Files:
        src/include: err.h stdio.h stdlib.h util.h
        src/include/ssp: stdio.h

Log Message:
Consistently use __printflike and __scanflike.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/include/err.h
cvs rdiff -u -r1.75 -r1.76 src/include/stdio.h
cvs rdiff -u -r1.90 -r1.91 src/include/stdlib.h
cvs rdiff -u -r1.54 -r1.55 src/include/util.h
cvs rdiff -u -r1.3 -r1.4 src/include/ssp/stdio.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/include/err.h
diff -u src/include/err.h:1.14 src/include/err.h:1.15
--- src/include/err.h:1.14	Thu Feb  3 04:39:32 2005
+++ src/include/err.h	Thu Feb 25 18:37:12 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: err.h,v 1.14 2005/02/03 04:39:32 perry Exp $	*/
+/*	$NetBSD: err.h,v 1.15 2010/02/25 18:37:12 joerg Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -46,21 +46,21 @@
 
 __BEGIN_DECLS
 __dead void	err(int, const char *, ...)
-		    __attribute__((__noreturn__, __format__(__printf__, 2, 3)));
+		     __printflike(2, 3) __dead;
 __dead void	verr(int, const char *, _BSD_VA_LIST_)
-		    __attribute__((__noreturn__, __format__(__printf__, 2, 0)));
+		    __printflike(2, 0) __dead;
 __dead void	errx(int, const char *, ...)
-		    __attribute__((__noreturn__, __format__(__printf__, 2, 3)));
+		     __printflike(2, 3) __dead;
 __dead void	verrx(int, const char *, _BSD_VA_LIST_)
-		    __attribute__((__noreturn__, __format__(__printf__, 2, 0)));
+		    __printflike(2, 0) __dead;
 void		warn(const char *, ...)
-		    __attribute__((__format__(__printf__, 1, 2)));
+		    __printflike(1, 2);
 void		vwarn(const char *, _BSD_VA_LIST_)
-		    __attribute__((__format__(__printf__, 1, 0)));
+		    __printflike(1, 0);
 void		warnx(const char *, ...)
-		    __attribute__((__format__(__printf__, 1, 2)));
+		    __printflike(1, 2);
 void		vwarnx(const char *, _BSD_VA_LIST_)
-		    __attribute__((__format__(__printf__, 1, 0)));
+		    __printflike(1, 0);
 __END_DECLS
 
 #endif /* !_ERR_H_ */

Index: src/include/stdio.h
diff -u src/include/stdio.h:1.75 src/include/stdio.h:1.76
--- src/include/stdio.h:1.75	Mon Jan 11 20:39:29 2010
+++ src/include/stdio.h	Thu Feb 25 18:37:12 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: stdio.h,v 1.75 2010/01/11 20:39:29 joerg Exp $	*/
+/*	$NetBSD: stdio.h,v 1.76 2010/02/25 18:37:12 joerg Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -226,14 +226,14 @@
 char	*fgets(char * __restrict, int, FILE * __restrict);
 FILE	*fopen(const char * __restrict , const char * __restrict);
 int	 fprintf(FILE * __restrict , const char * __restrict, ...)
-    __attribute__((__format__(__printf__, 2, 3)));
+		__printflike(2, 3);
 int	 fputc(int, FILE *);
 int	 fputs(const char * __restrict, FILE * __restrict);
 size_t	 fread(void * __restrict, size_t, size_t, FILE * __restrict);
 FILE	*freopen(const char * __restrict, const char * __restrict,
 	    FILE * __restrict);
 int	 fscanf(FILE * __restrict, const char * __restrict, ...)
-    __attribute__((__format__(__scanf__, 2, 3)));
+		__scanflike(2, 3);
 int	 fseek(FILE *, long, int);
 int	 fsetpos(FILE *, const fpos_t *);
 long	 ftell(FILE *);
@@ -245,33 +245,33 @@
 ssize_t	 getline(char ** __restrict, size_t * __restrict, FILE * __restrict);
 void	 perror(const char *);
 int	 printf(const char * __restrict, ...)
-    __attribute__((__format__(__printf__, 1, 2)));
+		__printflike(1, 2);
 int	 putc(int, FILE *);
 int	 putchar(int);
 int	 puts(const char *);
 int	 remove(const char *);
 void	 rewind(FILE *);
 int	 scanf(const char * __restrict, ...)
-    __attribute__((__format__(__scanf__, 1, 2)));
+		__scanflike(1, 2);
 void	 setbuf(FILE * __restrict, char * __restrict);
 int	 setvbuf(FILE * __restrict, char * __restrict, int, size_t);
 int	 sscanf(const char * __restrict, const char * __restrict, ...)
-    __attribute__((__format__(__scanf__, 2, 3)));
+		__scanflike(2, 3);
 FILE	*tmpfile(void);
 int	 ungetc(int, FILE *);
 int	 vfprintf(FILE * __restrict, const char * __restrict, _BSD_VA_LIST_)
-    __attribute__((__format__(__printf__, 2, 0)));
+		__printflike(2, 0);
 int	 vprintf(const char * __restrict, _BSD_VA_LIST_)
-    __attribute__((__format__(__printf__, 1, 0)));
+		__printflike(1, 0);
 
 #ifndef __AUDIT__
 char	*gets(char *);
 int	 sprintf(char * __restrict, const char * __restrict, ...)
-    __attribute__((__format__(__printf__, 2, 3)));
+		__printflike(2, 3);
 char	*tmpnam(char *);
 int	 vsprintf(char * __restrict, const char * __restrict,
     _BSD_VA_LIST_)
-    __attribute__((__format__(__printf__, 2, 0)));
+		__printflike(2, 0);
 #endif
 
 #if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
@@ -338,10 +338,10 @@
     defined(_ISOC99_SOURCE) || defined(_NETBSD_SOURCE)
 __BEGIN_DECLS
 int	 snprintf(char * __restrict, size_t, const char * __restrict, ...)
-    __attribute__((__format__(__printf__, 3, 4)));
+		__printflike(3, 4);
 int	 vsnprintf(char * __restrict, size_t, const char * __restrict,
 	    _BSD_VA_LIST_)
-    __attribute__((__format__(__printf__, 3, 0)));
+		__printflike(3, 0);
 __END_DECLS
 #endif
 
@@ -382,12 +382,12 @@
 #if defined(_ISOC99_SOURCE) || defined(_NETBSD_SOURCE)
 __BEGIN_DECLS
 int	 vscanf(const char * __restrict, _BSD_VA_LIST_)
-    __attribute__((__format__(__scanf__, 1, 0)));
+		__scanflike(1, 0);
 int	 vfscanf(FILE * __restrict, const char * __restrict, _BSD_VA_LIST_)
-    __attribute__((__format__(__scanf__, 2, 0)));
+		__scanflike(2, 0);
 int	 vsscanf(const char * __restrict, const char * __restrict,
     _BSD_VA_LIST_)
-    __attribute__((__format__(__scanf__, 2, 0)));
+    __scanflike(2, 0);
 __END_DECLS
 #endif /* _ISOC99_SOURCE || _NETBSD_SOURCE */
 
@@ -404,7 +404,7 @@
 
 __BEGIN_DECLS
 int	 asprintf(char ** __restrict, const char * __restrict, ...)
-    __attribute__((__format__(__printf__, 2, 3)));
+		__printflike(2, 3);
 char	*fgetln(FILE * __restrict, size_t * __restrict);
 char	*fparseln(FILE *, size_t *, size_t *, const char[3], int);
 int	 fpurge(FILE *);
@@ -412,9 +412,9 @@
 int	 setlinebuf(FILE *);
 int	 vasprintf(char ** __restrict, const char * __restrict,
     _BSD_VA_LIST_)
-    __attribute__((__format__(__printf__, 2, 0)));
+		__printflike(2, 0);
 const char *fmtcheck(const char *, const char *)
-    __attribute__((__format_arg__(2)));
+		__format_arg(2);
 __END_DECLS
 
 /*

Index: src/include/stdlib.h
diff -u src/include/stdlib.h:1.90 src/include/stdlib.h:1.91
--- src/include/stdlib.h:1.90	Sun Nov 15 22:21:03 2009
+++ src/include/stdlib.h	Thu Feb 25 18:37:12 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: stdlib.h,v 1.90 2009/11/15 22:21:03 christos Exp $	*/
+/*	$NetBSD: stdlib.h,v 1.91 2010/02/25 18:37:12 joerg Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -299,7 +299,7 @@
 	    uint32_t[3]);
 
 void	 setproctitle(const char *, ...)
-	    __attribute__((__format__(__printf__, 1, 2)));
+	    __printflike(1, 2);
 const char *getprogname(void) __attribute__((const));
 void	setprogname(const char *);
 

Index: src/include/util.h
diff -u src/include/util.h:1.54 src/include/util.h:1.55
--- src/include/util.h:1.54	Wed Jan 27 19:10:31 2010
+++ src/include/util.h	Thu Feb 25 18:37:12 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: util.h,v 1.54 2010/01/27 19:10:31 drochner Exp $	*/
+/*	$NetBSD: util.h,v 1.55 2010/02/25 18:37:12 joerg Exp $	*/
 
 /*-
  * Copyright (c) 1995
@@ -137,10 +137,10 @@
 void 		*erealloc(void *, size_t);
 struct __sFILE	*efopen(const char *, const char *);
 int	 	easprintf(char ** __restrict, const char * __restrict, ...)
-    __attribute__((__format__(__printf__, 2, 3)));
+			__printflike(2, 3);
 int		evasprintf(char ** __restrict, const char * __restrict,
     _BSD_VA_LIST_)
-    __attribute__((__format__(__printf__, 2, 0)));
+			__printflike(2, 0);
 __END_DECLS
 
 #endif /* !_UTIL_H_ */

Index: src/include/ssp/stdio.h
diff -u src/include/ssp/stdio.h:1.3 src/include/ssp/stdio.h:1.4
--- src/include/ssp/stdio.h:1.3	Mon Apr 28 20:22:54 2008
+++ src/include/ssp/stdio.h	Thu Feb 25 18:37:13 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: stdio.h,v 1.3 2008/04/28 20:22:54 martin Exp $	*/
+/*	$NetBSD: stdio.h,v 1.4 2010/02/25 18:37:13 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -35,14 +35,16 @@
 
 __BEGIN_DECLS
 int __sprintf_chk(char *__restrict, int, size_t, const char *__restrict, ...)
-    __attribute__((__format__(__printf__, 4, 5)));
+    __printflike(4, 5);
 int __vsprintf_chk(char *__restrict, int, size_t, const char *__restrict,
-    _BSD_VA_LIST_) __attribute__((__format__(__printf__, 4, 0)));
+    _BSD_VA_LIST_)
+    __printflike(4, 0);
 int __snprintf_chk(char *__restrict, size_t, int, size_t,
-    const char *__restrict, ...) __attribute__((__format__(__printf__, 5, 6)));
+    const char *__restrict, ...)
+    __printflike(5, 6);
 int __vsnprintf_chk(char *__restrict, size_t, int, size_t,
      const char *__restrict, _BSD_VA_LIST_)
-     __attribute__((__format__(__printf__, 5, 0)));
+    __printflike(5, 0);
 char *__gets_chk(char *, size_t);
 char *__fgets_chk(char *, int, size_t, FILE *);
 __END_DECLS

Reply via email to