Add prototypes for vwarn/vwarnx

Fixes this warning:
common.c:406:1: warning: no previous prototype for 'vwarn' [-Wmissing-prototypes]
  406 | vwarn(const char *fmt, va_list list)
      | ^~~~~
common.c:429:1: warning: no previous prototype for 'vwarnx' [-Wmissing-prototypes]
  429 | vwarnx(const char *fmt, va_list list)
      | ^~~~~~

Also move err() to have non-x versions first.
This commit is contained in:
Erik Ekman 2021-01-31 14:08:27 +01:00
parent 6a7763c210
commit dc307b7183
2 changed files with 15 additions and 13 deletions

View File

@ -425,6 +425,17 @@ warn(const char *fmt, ...)
va_end(list);
}
void
err(int eval, const char *fmt, ...)
{
va_list list;
va_start(list, fmt);
vwarn(fmt, list);
va_end(list);
exit(eval);
}
void
vwarnx(const char *fmt, va_list list)
{
@ -442,17 +453,6 @@ warnx(const char *fmt, ...)
va_end(list);
}
void
err(int eval, const char *fmt, ...)
{
va_list list;
va_start(list, fmt);
vwarn(fmt, list);
va_end(list);
exit(eval);
}
void
errx(int eval, const char *fmt, ...)
{

View File

@ -132,10 +132,12 @@ int check_topdomain(char *, char **);
int inet_aton(const char *cp, struct in_addr *inp);
#endif
void err(int eval, const char *fmt, ...);
void vwarn(const char *fmt, va_list list);
void warn(const char *fmt, ...);
void errx(int eval, const char *fmt, ...);
void err(int eval, const char *fmt, ...);
void vwarnx(const char *fmt, va_list list);
void warnx(const char *fmt, ...);
void errx(int eval, const char *fmt, ...);
#endif
int recent_seqno(int , int);