diff options
author | Andrew Bartlett <abartlet@samba.org> | 2004-08-25 07:15:21 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:58:21 -0500 |
commit | 5e869b4eabaf428b36b5bc158ab4047d25e3eb5b (patch) | |
tree | 927baab313e642e2f2800e0d1439e7be7f3673b0 /source4/lib | |
parent | 18797d8c70afc383aa7c67003646efb8ecfd7e4f (diff) | |
download | samba-5e869b4eabaf428b36b5bc158ab4047d25e3eb5b.tar.gz samba-5e869b4eabaf428b36b5bc158ab4047d25e3eb5b.tar.bz2 samba-5e869b4eabaf428b36b5bc158ab4047d25e3eb5b.zip |
r2055: Add PRINTF_ATTRIBUTE to many more parts of the code, and a new
--enable-developer warning for when they are missing.
Andrew Bartlett
(This used to be commit 8115e44d47bcd65edba08d10117180ae508cdbc1)
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/ldb/common/ldb_alloc.c | 2 | ||||
-rw-r--r-- | source4/lib/ldb/common/ldb_debug.c | 2 | ||||
-rw-r--r-- | source4/lib/ldb/common/ldb_ldif.c | 2 | ||||
-rw-r--r-- | source4/lib/talloc.c | 9 | ||||
-rw-r--r-- | source4/lib/tdb_helper.c | 2 |
5 files changed, 14 insertions, 3 deletions
diff --git a/source4/lib/ldb/common/ldb_alloc.c b/source4/lib/ldb/common/ldb_alloc.c index 667759e832..6abd6fa8c3 100644 --- a/source4/lib/ldb/common/ldb_alloc.c +++ b/source4/lib/ldb/common/ldb_alloc.c @@ -122,7 +122,7 @@ void *ldb_strdup(struct ldb_context *ldb, const char *str) /* a ldb wrapper for asprintf(), using ldb_malloc() */ -int ldb_asprintf(struct ldb_context *ldb, char **strp, const char *fmt, ...) +int ldb_asprintf(struct ldb_context *ldb, char **strp, const char *fmt, ...) _PRINTF_ATTRIBUTE(3, 4) { int len, len2; va_list ap; diff --git a/source4/lib/ldb/common/ldb_debug.c b/source4/lib/ldb/common/ldb_debug.c index d59f9284b0..0a187cd62d 100644 --- a/source4/lib/ldb/common/ldb_debug.c +++ b/source4/lib/ldb/common/ldb_debug.c @@ -52,6 +52,8 @@ int ldb_set_debug(struct ldb_context *ldb, debug function for ldb_set_debug_stderr */ static void ldb_debug_stderr(void *context, enum ldb_debug_level level, + const char *fmt, va_list ap) PRINTF_ATTRIBUTE(3,0); +static void ldb_debug_stderr(void *context, enum ldb_debug_level level, const char *fmt, va_list ap) { if (level <= LDB_DEBUG_WARNING) { diff --git a/source4/lib/ldb/common/ldb_ldif.c b/source4/lib/ldb/common/ldb_ldif.c index 8c912f76d4..c693d211a9 100644 --- a/source4/lib/ldb/common/ldb_ldif.c +++ b/source4/lib/ldb/common/ldb_ldif.c @@ -640,6 +640,8 @@ struct ldif_write_file_state { FILE *f; }; +static int fprintf_file(void *private_data, const char *fmt, ...) PRINTF_ATTRIBUTE(2, 3); + static int fprintf_file(void *private_data, const char *fmt, ...) { struct ldif_write_file_state *state = private_data; diff --git a/source4/lib/talloc.c b/source4/lib/talloc.c index 31b6584845..036d06a2c2 100644 --- a/source4/lib/talloc.c +++ b/source4/lib/talloc.c @@ -122,6 +122,8 @@ void talloc_increase_ref_count(void *ptr) /* add a name to an existing pointer - va_list version */ +static void talloc_set_name_v(void *ptr, const char *fmt, va_list ap) PRINTF_ATTRIBUTE(2,0); + static void talloc_set_name_v(void *ptr, const char *fmt, va_list ap) { struct talloc_chunk *tc = talloc_chunk_from_ptr(ptr); @@ -393,7 +395,8 @@ char *talloc_strndup(void *t, const char *p, size_t n) return ret; } - char *talloc_vasprintf(void *t, const char *fmt, va_list ap) +static char *talloc_vasprintf(void *t, const char *fmt, va_list ap) PRINTF_ATTRIBUTE(2,0); +static char *talloc_vasprintf(void *t, const char *fmt, va_list ap) { int len; char *ret; @@ -434,8 +437,10 @@ char *talloc_asprintf(void *t, const char *fmt, ...) _PRINTF_ATTRIBUTE(2,3) * and return @p s, which may have moved. Good for gradually * accumulating output into a string buffer. **/ + char *talloc_vasprintf_append(char *s, - const char *fmt, va_list ap) + const char *fmt, va_list ap) _PRINTF_ATTRIBUTE(2,0) + { int len, s_len; va_list ap2; diff --git a/source4/lib/tdb_helper.c b/source4/lib/tdb_helper.c index 22c4d1bb45..2698e3cc71 100644 --- a/source4/lib/tdb_helper.c +++ b/source4/lib/tdb_helper.c @@ -29,6 +29,8 @@ Log tdb messages via DEBUG(). ****************************************************************************/ +static void tdb_log(TDB_CONTEXT *tdb, int level, const char *format, ...) PRINTF_ATTRIBUTE(3,4); + static void tdb_log(TDB_CONTEXT *tdb, int level, const char *format, ...) { va_list ap; |