+2003-11-26 Theodore Ts'o <tytso@mit.edu>
+
+ * com_err.h, com_err.c: Use GCC attributes to mark com_err and
+ default_com_err_proc as taking printf-style format
+ strings.
+
2003-11-22 Theodore Ts'o <tytso@mit.edu>
* com_err.h: Retore the type of n_msgs in the error_table
static void
default_com_err_proc (const char *whoami, errcode_t code, const
char *fmt, va_list args)
+ COM_ERR_ATTR((format(printf, 3, 0)));
+
+static void
+default_com_err_proc (const char *whoami, errcode_t code, const
+ char *fmt, va_list args)
{
if (whoami) {
fputs(whoami, stderr);
#if !defined(__COM_ERR_H) && !defined(__COM_ERR_H__)
+#ifdef __GNUC__
+#define COM_ERR_ATTR(x) __attribute__(x)
+#else
+#define COM_ERR_ATTR(x)
+#endif
+
#include <stdarg.h>
typedef long errcode_t;
long base;
int n_msgs;
};
-
struct et_list;
-extern void com_err (const char *, long, const char *, ...);
+extern void com_err (const char *, long, const char *, ...)
+ COM_ERR_ATTR((format(printf, 3, 4)));
+
extern void com_err_va (const char *whoami, errcode_t code, const char *fmt,
- va_list args);
+ va_list args)
+ COM_ERR_ATTR((format(printf, 3, 0)));
+
extern char const *error_message (long);
extern void (*com_err_hook) (const char *, long, const char *, va_list);
extern void (*set_com_err_hook (void (*) (const char *, long,