mirror of
https://github.com/freebsd/freebsd-src
synced 2024-07-22 10:48:02 +00:00
Use correct function declaration for yyerror
According to the POSIX standard at https://pubs.opengroup.org/onlinepubs/9699919799/utilities/yacc.html `yyerror` should return `int`. Add unreachable since errx never returns. Reviewed by: imp, kib Differential Revision: https://reviews.freebsd.org/D45447
This commit is contained in:
parent
e3537f9235
commit
5dda778db6
|
@ -88,7 +88,7 @@ int maxusers;
|
|||
|
||||
#define ns(s) strdup(s)
|
||||
int include(const char *, int);
|
||||
void yyerror(const char *s);
|
||||
int yyerror(const char *s);
|
||||
int yywrap(void);
|
||||
|
||||
static void newdev(char *name);
|
||||
|
@ -299,11 +299,13 @@ NoDevice:
|
|||
|
||||
%%
|
||||
|
||||
void
|
||||
int
|
||||
yyerror(const char *s)
|
||||
{
|
||||
|
||||
errx(1, "%s:%d: %s", yyfile, yyline + 1, s);
|
||||
__unreachable();
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
|
|
Loading…
Reference in a new issue