Commit 15947da1 15947da1c2dba775e811bf4b00f814c8bb4385ec by Sergey Poznyakoff

Mark printf-like calls with MU_PRINTFLIKE.

1 parent 5cc98723
......@@ -66,7 +66,7 @@ void collect_create_mailbox (void);
void collect_drop_mailbox (void);
int collect_output (void);
void util_error (char *fmt, ...);
void util_error (char *fmt, ...) MU_PRINTFLIKE(1, 2);
int util_tempfile (char **namep);
struct guimb_data
......
......@@ -241,12 +241,13 @@ extern void imap4d_capability_remove (const char *str);
extern void imap4d_capability_init (void);
/* Helper functions. */
extern int util_out (int, const char *, ...);
extern int util_send (const char *, ...);
extern int util_out (int, const char *, ...) MU_PRINTFLIKE(2,3);
extern int util_send (const char *, ...) MU_PRINTFLIKE(1,2);
extern int util_send_qstring (const char *);
extern int util_send_literal (const char *);
extern int util_start (char *);
extern int util_finish (struct imap4d_command *, int, const char *, ...);
extern int util_finish (struct imap4d_command *, int, const char *, ...)
MU_PRINTFLIKE(3,4);
extern int util_getstate (void);
extern int util_do_command (char *);
extern char *imap4d_readline (void);
......
......@@ -37,7 +37,7 @@ extern void * mu_debug_get_owner (mu_debug_t);
extern int mu_debug_set_level (mu_debug_t, size_t level);
extern int mu_debug_get_level (mu_debug_t, size_t *plevel);
extern int mu_debug_print (mu_debug_t debug, size_t level,
const char *format, ...);
const char *format, ...) MU_PRINTFLIKE(3,4);
extern int mu_debug_printv (mu_debug_t debug, size_t level,
const char *format, va_list argp);
extern int mu_debug_set_print (mu_debug_t,
......
......@@ -30,7 +30,7 @@ extern "C" {
typedef int (*mu_error_pfn_t) (const char *fmt, va_list ap);
extern int mu_verror (const char *fmt, va_list ap);
extern int mu_error (const char *fmt, ...);
extern int mu_error (const char *fmt, ...) MU_PRINTFLIKE(1,2);
extern void mu_error_set_print (mu_error_pfn_t);
int mu_default_error_printer (const char *fmt, va_list ap);
......
......@@ -239,12 +239,16 @@ int mu_sieve_get_message_sender (mu_message_t msg, char **ptext);
/* Logging and diagnostic functions */
void mu_sieve_error (mu_sieve_machine_t mach, const char *fmt, ...);
void mu_sieve_debug (mu_sieve_machine_t mach, const char *fmt, ...);
void mu_sieve_error (mu_sieve_machine_t mach, const char *fmt, ...)
MU_PRINTFLIKE(2,3);
void mu_sieve_debug (mu_sieve_machine_t mach, const char *fmt, ...)
MU_PRINTFLIKE(2,3);
void mu_sieve_log_action (mu_sieve_machine_t mach, const char *action,
const char *fmt, ...);
const char *fmt, ...)
MU_PRINTFLIKE(3,4);
void mu_sieve_abort (mu_sieve_machine_t mach);
int mu_stream_printf (mu_stream_t stream, size_t * off, const char *fmt, ...);
int mu_stream_printf (mu_stream_t stream, size_t * off, const char *fmt, ...)
MU_PRINTFLIKE(3,4);
void mu_sieve_arg_error (mu_sieve_machine_t mach, int n);
int mu_sieve_is_dry_run (mu_sieve_machine_t mach);
......
......@@ -229,7 +229,8 @@ extern int mu_nntp_response (mu_nntp_t nntp, char *buffer,
/* pop3_writeline copies the line in the internal buffer, a mu_pop3_send() is
needed to do the actual transmission. */
extern int mu_nntp_writeline (mu_nntp_t nntp, const char *format, ...);
extern int mu_nntp_writeline (mu_nntp_t nntp, const char *format, ...)
MU_PRINTFLIKE(2,3);
/* mu_pop3_sendline() is equivalent to:
mu_pop3_writeline (pop3, line);
......
......@@ -102,7 +102,8 @@ extern int mu_pop3_response (mu_pop3_t pop3, char *buffer, size_t buflen, s
/* pop3_writeline copies the line in the internal buffer, a mu_pop3_send() is
needed to do the actual transmission. */
extern int mu_pop3_writeline (mu_pop3_t pop3, const char *format, ...);
extern int mu_pop3_writeline (mu_pop3_t pop3, const char *format, ...)
MU_PRINTFLIKE(2,3);
/* mu_pop3_sendline() is equivalent to:
mu_pop3_writeline (pop3, line);
......
......@@ -222,7 +222,7 @@ struct _msg_imap
size_t header_lines;
};
int imap_writeline (f_imap_t, const char *format, ...);
int imap_writeline (f_imap_t, const char *format, ...) MU_PRINTFLIKE(2,3);
int imap_write (f_imap_t);
int imap_send (f_imap_t);
int imap_parse (f_imap_t);
......
......@@ -89,9 +89,9 @@ extern int sieve_error_count;
#define TAG_RELFUN "__relfun__"
void sieve_compile_error (const char *filename, int linenum,
const char *fmt, ...);
const char *fmt, ...) MU_PRINTFLIKE(3,4);
void sieve_debug_internal (mu_sieve_printf_t printer, void *data,
const char *fmt, ...);
const char *fmt, ...) MU_PRINTFLIKE(3,4);
void sieve_print_value (mu_sieve_value_t *val, mu_sieve_printf_t printer,
void *data);
void sieve_print_value_list (mu_list_t list, mu_sieve_printf_t printer, void *data);
......
......@@ -112,7 +112,7 @@ extern int check_quota (struct mu_auth_data *auth,
int mda (mu_mailbox_t mbx, char *username);
int switch_user_id (struct mu_auth_data *auth, int user);
void mailer_err (char *fmt, ...);
void mailer_err (char *fmt, ...) MU_PRINTFLIKE(1,2);
#ifdef WITH_GUILE
struct mda_data
......
......@@ -302,7 +302,7 @@ extern int msgset_member (msgset_t *set, size_t n);
extern msgset_t *msgset_negate (msgset_t *set);
extern size_t msgset_count (msgset_t *set);
extern int util_do_command (const char *cmd, ...);
extern int util_do_command (const char *cmd, ...) MU_PRINTFLIKE(1,2);
extern int util_foreach_msg (int argc, char **argv, int flags,
msg_handler_t func, void *data);
......@@ -353,7 +353,7 @@ extern void util_strupper (char *str);
extern void util_escape_percent (char **str);
extern char *util_outfolder_name (char *str);
extern void util_save_outgoing (mu_message_t msg, char *savefile);
extern void util_error (const char *format, ...);
extern void util_error (const char *format, ...) MU_PRINTFLIKE(1,2);
extern int util_error_range (size_t msgno);
extern void util_noapp (void);
extern int util_tempfile (char **namep);
......@@ -365,7 +365,7 @@ extern int util_get_hdr_value (mu_header_t hdr, const char *name, char **value);
extern int util_merge_addresses (char **addr_str, const char *value);
extern int util_header_expand (mu_header_t *hdr);
extern int util_get_message (mu_mailbox_t mbox, size_t msgno, mu_message_t *msg);
void util_cache_command (mu_list_t *list, const char *fmt, ...);
void util_cache_command (mu_list_t *list, const char *fmt, ...) MU_PRINTFLIKE(2,3);
void util_run_cached_commands (mu_list_t *list);
const char *util_reply_prefix (void);
void util_rfc2047_decode (char **value);
......
......@@ -259,8 +259,8 @@ int mh_global_sequences_iterate (mh_context_iterator fp, void *data);
void mh_global_sequences_drop (void);
int mh_interactive_mode_p (void);
int mh_getyn (const char *fmt, ...);
int mh_getyn_interactive (const char *fmt, ...);
int mh_getyn (const char *fmt, ...) MU_PRINTFLIKE(1,2);
int mh_getyn_interactive (const char *fmt, ...) MU_PRINTFLIKE(1,2);
int mh_check_folder (const char *pathname, int confirm);
int mh_makedir (const char *p);
......@@ -273,7 +273,7 @@ void mh_format_debug (int val);
void mh_format_free (mh_format_t *fmt);
mh_builtin_t *mh_lookup_builtin (char *name, int *rest);
void mh_error (const char *fmt, ...);
void mh_error (const char *fmt, ...) MU_PRINTFLIKE(1,2);
void mh_err_memory (int fatal);
FILE *mh_audit_open (char *name, mu_mailbox_t mbox);
......@@ -364,6 +364,6 @@ void mh_comp_draft (const char *formfile, const char *defformfile,
const char *draftfile);
int check_draft_disposition (struct mh_whatnow_env *wh, int use_draft);
void ali_parse_error (char *fmt, ...);
void ali_parse_error (char *fmt, ...) MU_PRINTFLIKE(1,2);
void ali_verbatim (int enable);
......
......@@ -249,7 +249,7 @@ extern int pop3d_touchlock (void);
extern int pop3d_uidl (const char *);
extern int pop3d_user (const char *);
extern int pop3d_unlock (void);
extern void pop3d_outf (const char *fmt, ...);
extern void pop3d_outf (const char *fmt, ...) MU_PRINTFLIKE(1,2);
extern void pop3d_setio (FILE *in, FILE *out);
extern char *pop3d_readline (char *, size_t);
......