Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/include Consistently use __printflike and __scanflike.



details:   https://anonhg.NetBSD.org/src/rev/8fc955fd621e
branches:  trunk
changeset: 752420:8fc955fd621e
user:      joerg <joerg%NetBSD.org@localhost>
date:      Thu Feb 25 18:37:12 2010 +0000

description:
Consistently use __printflike and __scanflike.

diffstat:

 include/err.h       |  18 +++++++++---------
 include/ssp/stdio.h |  12 +++++++-----
 include/stdio.h     |  36 ++++++++++++++++++------------------
 include/stdlib.h    |   4 ++--
 include/util.h      |   6 +++---
 5 files changed, 39 insertions(+), 37 deletions(-)

diffs (226 lines):

diff -r b65ac7387e8a -r 8fc955fd621e include/err.h
--- a/include/err.h     Thu Feb 25 17:15:55 2010 +0000
+++ b/include/err.h     Thu Feb 25 18:37:12 2010 +0000
@@ -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_ */
diff -r b65ac7387e8a -r 8fc955fd621e include/ssp/stdio.h
--- a/include/ssp/stdio.h       Thu Feb 25 17:15:55 2010 +0000
+++ b/include/ssp/stdio.h       Thu Feb 25 18:37:12 2010 +0000
@@ -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
diff -r b65ac7387e8a -r 8fc955fd621e include/stdio.h
--- a/include/stdio.h   Thu Feb 25 17:15:55 2010 +0000
+++ b/include/stdio.h   Thu Feb 25 18:37:12 2010 +0000
@@ -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
 
 /*
diff -r b65ac7387e8a -r 8fc955fd621e include/stdlib.h
--- a/include/stdlib.h  Thu Feb 25 17:15:55 2010 +0000
+++ b/include/stdlib.h  Thu Feb 25 18:37:12 2010 +0000
@@ -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 *);
 
diff -r b65ac7387e8a -r 8fc955fd621e include/util.h
--- a/include/util.h    Thu Feb 25 17:15:55 2010 +0000
+++ b/include/util.h    Thu Feb 25 18:37:12 2010 +0000
@@ -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_ */



Home | Main Index | Thread Index | Old Index