Skip to content

Commit

Permalink
Merge pull request #5210 from cyrusimap/cyr-624-compile-clang-werror
Browse files Browse the repository at this point in the history
Make Cyrus build with clang `-Werror`
  • Loading branch information
rsto authored Jan 16, 2025
2 parents ad34908 + 3bbcc93 commit e2753b2
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 18 deletions.
12 changes: 5 additions & 7 deletions com_err/et/com_err.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,10 @@ errf com_err_hook = default_com_err_proc;

void
__attribute__((format(printf, 3, 0)))
com_err_va (whoami, code, fmt, args)
const char *whoami;
long code;
const char *fmt;
va_list args;
com_err_va (const char *whoami,
long code,
const char *fmt,
va_list args)
{
(*com_err_hook) (whoami, code, fmt, args);
}
Expand Down Expand Up @@ -172,8 +171,7 @@ EXPORTED void INTERFACE_C com_err (va_alist)
va_end(pvar);
}

errf set_com_err_hook (new_proc)
errf new_proc;
errf set_com_err_hook (errf new_proc)
{
errf x = com_err_hook;

Expand Down
3 changes: 1 addition & 2 deletions com_err/et/error_message.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ static char buffer[25];

extern struct et_list * _et_list;

EXPORTED const char * INTERFACE error_message (code)
long code;
EXPORTED const char * INTERFACE error_message (long code)
{
int offset;
long l_offset;
Expand Down
3 changes: 1 addition & 2 deletions com_err/et/et_name.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ static const char char_set[] =

static char buf[6];

const char * error_table_name (num)
long num;
const char * error_table_name (long num)
{
long ch;
int i;
Expand Down
7 changes: 3 additions & 4 deletions com_err/et/init_et.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,9 @@

extern struct et_list * _et_list;

int init_error_table(msgs, base, count)
const char * const * msgs;
int base;
int count;
int init_error_table(const char * const * msgs,
int base,
int count)
{
struct et_list *etl;
struct error_table *et;
Expand Down
4 changes: 2 additions & 2 deletions imap/conversations.c
Original file line number Diff line number Diff line change
Expand Up @@ -2267,15 +2267,15 @@ static int conversations_guid_setitem(struct conversations_state *state,
if (add) {
struct buf val = BUF_INITIALIZER;
if (state->folders_byname) {
buf_putc(&val, 0x80 | CONV_GUIDREC_BYNAME_VERSION);
buf_putc(&val, (char) (0x80 | CONV_GUIDREC_BYNAME_VERSION));
buf_appendbit64(&val, cid);
buf_appendbit32(&val, system_flags);
buf_appendbit32(&val, internal_flags);
buf_appendbit64(&val, (bit64)internaldate);
}
/* When bumping the G value version, make sure to update _guid_cb */
else {
buf_putc(&val, 0x80 | CONV_GUIDREC_VERSION);
buf_putc(&val, (char) (0x80 | CONV_GUIDREC_VERSION));
buf_appendbit64(&val, cid);
buf_appendbit32(&val, system_flags);
buf_appendbit32(&val, internal_flags);
Expand Down
3 changes: 2 additions & 1 deletion imap/imapd.c
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,8 @@ extern int saslserver(sasl_conn_t *conn, const char *mech,
/* Enable the resetting of a sasl_conn_t */
static int reset_saslconn(sasl_conn_t **conn);

void shut_down(int code) __attribute__((noreturn));

static int imapd_canon_user(sasl_conn_t *conn, void *context,
const char *user, unsigned ulen,
unsigned flags, const char *user_realm,
Expand Down Expand Up @@ -1314,7 +1316,6 @@ static void motd_file(void)
/*
* Cleanly shut down and exit
*/
void shut_down(int code) __attribute__((noreturn));
void shut_down(int code)
{
int i;
Expand Down

0 comments on commit e2753b2

Please sign in to comment.