[dovecot-cvs] dovecot/src/lib failures.c, 1.27.2.1, 1.27.2.2 failures.h, 1.9, 1.9.2.1 imem.h, 1.10, 1.10.2.1 macros.h, 1.16, 1.16.2.1 str.h, 1.8, 1.8.2.1 strfuncs.h, 1.28, 1.28.2.1
tss at dovecot.org
tss at dovecot.org
Wed Nov 1 18:50:17 UTC 2006
- Previous message: [dovecot-cvs] dovecot/src/lib failures.c, 1.28, 1.29 failures.h, 1.9, 1.10 imem.h, 1.11, 1.12 macros.h, 1.16, 1.17 str.h, 1.9, 1.10 strfuncs.h, 1.29, 1.30
- Next message: [dovecot-cvs] dovecot/src/lib data-stack.h, 1.6, 1.7 imem.h, 1.12, 1.13 macros.h, 1.17, 1.18 mempool.h, 1.19, 1.20 strfuncs.h, 1.30, 1.31
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /var/lib/cvs/dovecot/src/lib
In directory talvi:/tmp/cvs-serv5753
Modified Files:
Tag: branch_1_0
failures.c failures.h imem.h macros.h str.h strfuncs.h
Log Message:
Added sentinel GCC attribute to *_strconcat() functions. Added
format printf-attribute to vprintf-type functions.
Index: failures.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/failures.c,v
retrieving revision 1.27.2.1
retrieving revision 1.27.2.2
diff -u -d -r1.27.2.1 -r1.27.2.2
--- failures.c 2 Jul 2006 13:47:00 -0000 1.27.2.1
+++ failures.c 1 Nov 2006 18:50:14 -0000 1.27.2.2
@@ -12,13 +12,16 @@
#include <time.h>
static void default_panic_handler(const char *format, va_list args)
- __attr_noreturn__;
+ __attr_noreturn__ __attr_format__(1, 0);
static void default_fatal_handler(int status, const char *format, va_list args)
- __attr_noreturn__;
+ __attr_noreturn__ __attr_format__(2, 0);
-static void default_error_handler(const char *format, va_list args);
-static void default_warning_handler(const char *format, va_list args);
-static void default_info_handler(const char *format, va_list args);
+static void default_error_handler(const char *format, va_list args)
+ __attr_format__(1, 0);
+static void default_warning_handler(const char *format, va_list args)
+ __attr_format__(1, 0);
+static void default_info_handler(const char *format, va_list args)
+ __attr_format__(1, 0);
/* Initialize working defaults */
static failure_callback_t *panic_handler __attr_noreturn__ =
Index: failures.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/failures.h,v
retrieving revision 1.9
retrieving revision 1.9.2.1
diff -u -d -r1.9 -r1.9.2.1
--- failures.h 10 May 2004 16:05:10 -0000 1.9
+++ failures.h 1 Nov 2006 18:50:14 -0000 1.9.2.1
@@ -34,12 +34,16 @@
void i_set_info_handler(failure_callback_t *callback);
/* Send failures to syslog() */
-void i_syslog_panic_handler(const char *fmt, va_list args) __attr_noreturn__;
+void i_syslog_panic_handler(const char *fmt, va_list args)
+ __attr_noreturn__ __attr_format__(1, 0);
void i_syslog_fatal_handler(int status, const char *fmt, va_list args)
- __attr_noreturn__;
-void i_syslog_error_handler(const char *fmt, va_list args);
-void i_syslog_warning_handler(const char *fmt, va_list args);
-void i_syslog_info_handler(const char *fmt, va_list args);
+ __attr_noreturn__ __attr_format__(2, 0);
+void i_syslog_error_handler(const char *fmt, va_list args)
+ __attr_format__(1, 0);
+void i_syslog_warning_handler(const char *fmt, va_list args)
+ __attr_format__(1, 0);
+void i_syslog_info_handler(const char *fmt, va_list args)
+ __attr_format__(1, 0);
/* Open syslog and set failure/info handlers to use it. */
void i_set_failure_syslog(const char *ident, int options, int facility);
Index: imem.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/imem.h,v
retrieving revision 1.10
retrieving revision 1.10.2.1
diff -u -d -r1.10 -r1.10.2.1
--- imem.h 3 May 2005 17:02:42 -0000 1.10
+++ imem.h 1 Nov 2006 18:50:14 -0000 1.10.2.1
@@ -29,9 +29,9 @@
char *i_strdup_until(const void *str, const void *end); /* *end isn't included */
char *i_strndup(const void *str, size_t max_chars);
char *i_strdup_printf(const char *format, ...) __attr_format__(1, 2);
-char *i_strdup_vprintf(const char *format, va_list args);
+char *i_strdup_vprintf(const char *format, va_list args) __attr_format__(1, 0);
-char *i_strconcat(const char *str1, ...); /* NULL terminated */
+char *i_strconcat(const char *str1, ...) __attr_sentinel__;
void imem_init(void);
void imem_deinit(void);
Index: macros.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/macros.h,v
retrieving revision 1.16
retrieving revision 1.16.2.1
diff -u -d -r1.16 -r1.16.2.1
--- macros.h 16 Oct 2004 14:59:32 -0000 1.16
+++ macros.h 1 Nov 2006 18:50:14 -0000 1.16.2.1
@@ -102,6 +102,12 @@
# define __attr_unused__ __attribute__((unused))
# define __attr_noreturn__ __attribute__((noreturn))
# define __attr_const__ __attribute__((const))
+# if __GNUC__ > 3
+/* GCC 4.0 and later */
+# define __attr_sentinel__ __attribute__((sentinel))
+# else
+# define __attr_sentinel__
+# endif
#else
# define __attr_format__(format_idx, arg_idx)
# define __attr_format_arg__(arg_idx)
@@ -109,6 +115,7 @@
# define __attr_noreturn__
# define __attr_const__
# define __attr_unused__
+# define __attr_sentinel__
#endif
/* C99-style struct member definitions */
Index: str.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/str.h,v
retrieving revision 1.8
retrieving revision 1.8.2.1
diff -u -d -r1.8 -r1.8.2.1
--- str.h 14 Jan 2006 18:47:22 -0000 1.8
+++ str.h 1 Nov 2006 18:50:14 -0000 1.8.2.1
@@ -20,7 +20,8 @@
/* Append printf()-like data */
void str_printfa(string_t *str, const char *fmt, ...)
__attr_format__(2, 3);
-void str_vprintfa(string_t *str, const char *fmt, va_list args);
+void str_vprintfa(string_t *str, const char *fmt, va_list args)
+ __attr_format__(2, 0);
void str_insert(string_t *str, size_t pos, const char *cstr);
void str_delete(string_t *str, size_t pos, size_t len);
Index: strfuncs.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/strfuncs.h,v
retrieving revision 1.28
retrieving revision 1.28.2.1
diff -u -d -r1.28 -r1.28.2.1
--- strfuncs.h 27 Feb 2006 16:14:55 -0000 1.28
+++ strfuncs.h 1 Nov 2006 18:50:14 -0000 1.28.2.1
@@ -18,8 +18,9 @@
char *p_strndup(pool_t pool, const void *str, size_t max_chars);
char *p_strdup_printf(pool_t pool, const char *format, ...)
__attr_format__(2, 3);
-char *p_strdup_vprintf(pool_t pool, const char *format, va_list args);
-char *p_strconcat(pool_t pool, const char *str1, ...); /* NULL terminated */
+char *p_strdup_vprintf(pool_t pool, const char *format, va_list args)
+ __attr_format__(2, 0);
+char *p_strconcat(pool_t pool, const char *str1, ...) __attr_sentinel__;
/* same with temporary memory allocations: */
const char *t_strdup(const char *str);
@@ -28,8 +29,9 @@
const char *t_strdup_until(const void *start, const void *end); /* *end isn't included */
const char *t_strndup(const void *str, size_t max_chars);
const char *t_strdup_printf(const char *format, ...) __attr_format__(1, 2);
-const char *t_strdup_vprintf(const char *format, va_list args);
-const char *t_strconcat(const char *str1, ...); /* NULL terminated */
+const char *t_strdup_vprintf(const char *format, va_list args)
+ __attr_format__(1, 0);
+const char *t_strconcat(const char *str1, ...) __attr_sentinel__;
/* Like t_strdup(), but stop at cutchar. */
const char *t_strcut(const char *str, char cutchar);
- Previous message: [dovecot-cvs] dovecot/src/lib failures.c, 1.28, 1.29 failures.h, 1.9, 1.10 imem.h, 1.11, 1.12 macros.h, 1.16, 1.17 str.h, 1.9, 1.10 strfuncs.h, 1.29, 1.30
- Next message: [dovecot-cvs] dovecot/src/lib data-stack.h, 1.6, 1.7 imem.h, 1.12, 1.13 macros.h, 1.17, 1.18 mempool.h, 1.19, 1.20 strfuncs.h, 1.30, 1.31
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the dovecot-cvs
mailing list