Source-Changes-HG archive

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

[src/trunk]: src/bin/sh add more gcc printf format attributes



details:   https://anonhg.NetBSD.org/src/rev/368eed6376e7
branches:  trunk
changeset: 768621:368eed6376e7
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Aug 23 09:59:20 2011 +0000

description:
add more gcc printf format attributes

diffstat:

 bin/sh/error.h  |  32 +++++++++++++++++++++-----------
 bin/sh/output.h |  13 +++++++------
 2 files changed, 28 insertions(+), 17 deletions(-)

diffs (81 lines):

diff -r 8e53ad95ca2b -r 368eed6376e7 bin/sh/error.h
--- a/bin/sh/error.h    Tue Aug 23 08:10:08 2011 +0000
+++ b/bin/sh/error.h    Tue Aug 23 09:59:20 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: error.h,v 1.17 2008/03/29 09:58:00 apb Exp $   */
+/*     $NetBSD: error.h,v 1.18 2011/08/23 09:59:20 christos Exp $      */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -91,19 +91,29 @@
 #if ! defined(SHELL_BUILTIN)
 void exraise(int) __attribute__((__noreturn__));
 void onint(void);
-void error(const char *, ...) __attribute__((__noreturn__));
-void exerror(int, const char *, ...) __attribute__((__noreturn__));
+void error(const char *, ...) __attribute__((__noreturn__))
+    __attribute__((__format__(__printf__, 1, 2)));
+void exerror(int, const char *, ...) __attribute__((__noreturn__))
+    __attribute__((__format__(__printf__, 2, 3)));
 const char *errmsg(int, int);
 #endif /* ! SHELL_BUILTIN */
 
-void sh_err(int, const char *, ...) __attribute__((__noreturn__));
-void sh_verr(int, const char *, va_list) __attribute__((__noreturn__));
-void sh_errx(int, const char *, ...) __attribute__((__noreturn__));
-void sh_verrx(int, const char *, va_list) __attribute__((__noreturn__));
-void sh_warn(const char *, ...);
-void sh_vwarn(const char *, va_list);
-void sh_warnx(const char *, ...);
-void sh_vwarnx(const char *, va_list);
+void sh_err(int, const char *, ...) __attribute__((__noreturn__))
+    __attribute__((__format__(__printf__, 2, 3)));
+void sh_verr(int, const char *, va_list) __attribute__((__noreturn__))
+    __attribute__((__format__(__printf__, 2, 0)));
+void sh_errx(int, const char *, ...) __attribute__((__noreturn__))
+    __attribute__((__format__(__printf__, 2, 3)));
+void sh_verrx(int, const char *, va_list) __attribute__((__noreturn__))
+    __attribute__((__format__(__printf__, 2, 0)));
+void sh_warn(const char *, ...)
+    __attribute__((__format__(__printf__, 1, 2)));
+void sh_vwarn(const char *, va_list)
+    __attribute__((__format__(__printf__, 1, 0)));
+void sh_warnx(const char *, ...)
+    __attribute__((__format__(__printf__, 1, 2)));
+void sh_vwarnx(const char *, va_list)
+    __attribute__((__format__(__printf__, 1, 0)));
 
 void sh_exit(int) __attribute__((__noreturn__));
 
diff -r 8e53ad95ca2b -r 368eed6376e7 bin/sh/output.h
--- a/bin/sh/output.h   Tue Aug 23 08:10:08 2011 +0000
+++ b/bin/sh/output.h   Tue Aug 23 09:59:20 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: output.h,v 1.22 2010/10/29 17:06:53 stacktic Exp $     */
+/*     $NetBSD: output.h,v 1.23 2011/08/23 09:59:20 christos Exp $     */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -67,16 +67,17 @@
 void flushout(struct output *);
 void freestdout(void);
 void outfmt(struct output *, const char *, ...)
-    __attribute__((__format__(__printf__,2,3)));
+    __attribute__((__format__(__printf__, 2, 3)));
 void out1fmt(const char *, ...)
-    __attribute__((__format__(__printf__,1,2)));
+    __attribute__((__format__(__printf__, 1, 2)));
 #ifdef DEBUG
 void debugprintf(const char *, ...)
-    __attribute__((__format__(__printf__,1,2)));
+    __attribute__((__format__(__printf__, 1, 2)));
 #endif
 void fmtstr(char *, size_t, const char *, ...)
-    __attribute__((__format__(__printf__,3,4)));
-void doformat(struct output *, const char *, va_list);
+    __attribute__((__format__(__printf__, 3, 4)));
+void doformat(struct output *, const char *, va_list)
+    __attribute__((__format__(__printf__, 2, 0)));
 int xwrite(int, char *, int);
 int xioctl(int, unsigned long, char *);
 



Home | Main Index | Thread Index | Old Index