Mark functions handling format strings with __printflike
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
diff --git a/include/bsd/err.h b/include/bsd/err.h
index fcaaa85..b465c1b 100644
--- a/include/bsd/err.h
+++ b/include/bsd/err.h
@@ -39,10 +39,14 @@
#include <stdarg.h>
__BEGIN_DECLS
-extern void warnc (int code, const char *format, ...);
-extern void vwarnc (int code, const char *format, va_list ap);
-extern void errc (int status, int code, const char *format, ...);
-extern void verrc (int status, int code, const char *format, va_list ap);
+void warnc(int code, const char *format, ...)
+ __printflike(2, 3);
+void vwarnc(int code, const char *format, va_list ap)
+ __printflike(2, 0);
+void errc(int status, int code, const char *format, ...)
+ __printflike(3, 4);
+void verrc(int status, int code, const char *format, va_list ap)
+ __printflike(3, 0);
__END_DECLS
#endif
diff --git a/include/bsd/unistd.h b/include/bsd/unistd.h
index 5dfa605..78a4525 100644
--- a/include/bsd/unistd.h
+++ b/include/bsd/unistd.h
@@ -60,7 +60,8 @@ void closefrom(int lowfd);
#define initsetproctitle(c, a, e) setproctitle_init((c), (a), (e))
void setproctitle_init(int argc, char *argv[], char *envp[]);
-void setproctitle(const char *fmt, ...);
+void setproctitle(const char *fmt, ...)
+ __printflike(1, 2);
int getpeereid(int s, uid_t *euid, gid_t *egid);
__END_DECLS