Module Name: src
Committed By: christos
Date: Tue Aug 23 09:59:20 UTC 2011
Modified Files:
src/bin/sh: error.h output.h
Log Message:
add more gcc printf format attributes
To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/bin/sh/error.h
cvs rdiff -u -r1.22 -r1.23 src/bin/sh/output.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/bin/sh/error.h
diff -u src/bin/sh/error.h:1.17 src/bin/sh/error.h:1.18
--- src/bin/sh/error.h:1.17 Sat Mar 29 05:58:00 2008
+++ src/bin/sh/error.h Tue Aug 23 05:59:20 2011
@@ -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__));
Index: src/bin/sh/output.h
diff -u src/bin/sh/output.h:1.22 src/bin/sh/output.h:1.23
--- src/bin/sh/output.h:1.22 Fri Oct 29 13:06:53 2010
+++ src/bin/sh/output.h Tue Aug 23 05:59:20 2011
@@ -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 *);