diff --git a/WHATS_NEW b/WHATS_NEW index 39b800085..6d7597e0e 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,4 +1,5 @@ Version 2.02.28 - + Use gcc's printf attribute wherever possible. In _line_append, use "sizeof buf - 1" rather than equivalent "4095" Introduce is_same_inode macro, now including a comparison of st_dev. Don't leak a file descriptor in _lock_file(), when flock fails. diff --git a/daemons/clvmd/clvmd.h b/daemons/clvmd/clvmd.h index 8842936b3..98c40cee9 100644 --- a/daemons/clvmd/clvmd.h +++ b/daemons/clvmd/clvmd.h @@ -115,7 +115,8 @@ extern int add_client(struct local_client *new_client); extern void clvmd_cluster_init_completed(void); extern void process_message(struct local_client *client, const char *buf, int len, const char *csid); -extern void debuglog(const char *fmt, ... ); +extern void debuglog(const char *fmt, ... ) + __attribute__ ((format(printf, 1, 2))); int sync_lock(const char *resource, int mode, int flags, int *lockid); int sync_unlock(const char *resource, int lockid); diff --git a/lib/config/config.c b/lib/config/config.c index bbfe7dfb1..f15f46dc4 100644 --- a/lib/config/config.c +++ b/lib/config/config.c @@ -360,6 +360,8 @@ static int _line_start(struct output_line *outline) return 1; } +static int _line_append(struct output_line *outline, const char *fmt, ...) + __attribute__ ((format(printf, 2, 3))); static int _line_append(struct output_line *outline, const char *fmt, ...) { char buf[4096]; diff --git a/lib/misc/lvm-string.h b/lib/misc/lvm-string.h index c5a87811d..12e7957d1 100644 --- a/lib/misc/lvm-string.h +++ b/lib/misc/lvm-string.h @@ -23,7 +23,8 @@ struct pool; -int emit_to_buffer(char **buffer, size_t *size, const char *fmt, ...); +int emit_to_buffer(char **buffer, size_t *size, const char *fmt, ...) + __attribute__ ((format(printf, 3, 4))); char *build_dm_name(struct dm_pool *mem, const char *vg, const char *lv, const char *layer);