Skip to content

Commit

Permalink
com_err: fix function declarations without prototype
Browse files Browse the repository at this point in the history
Otherwise, clang-18 fails with

    error: a function definition without a prototype is deprecated
    in all versions of C and is not supported in C23
    [-Werror,-Wdeprecated-non-prototype]
  • Loading branch information
rsto committed Jan 10, 2025
1 parent fb218d0 commit 5d4625d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 15 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

0 comments on commit 5d4625d

Please sign in to comment.