Modernise yyerror

Newer versions of bison emit a prototype for yyerror
	void yyerror (const char *);
This clashes with some of our old code that declares yyerror to return
an int.  Fix that in most cases by modernizing yyerror.  bfin-parse.y
uses the return value all over the place, so for there disable
generation of the prototype as specified by posix.

binutils/
	* arparse.y (yyerror): Return void.
	* dlltool.c (yyerror): Likewise.
	* dlltool.h (yyerror): Likewise.
	* sysinfo.y (yyerror): Likewise.
	* windmc.h (yyerror): Likewise.
	* mclex.c (mc_error): Extract from ..
	(yyerror): ..here, both now returning void.
gas/
	* config/bfin-parse.y (yyerror): Define.
	(yyerror): Make static.
	* itbl-parse.y (yyerror): Return void.
ld/
	* deffilep.y (def_error): Return void.
This commit is contained in:
Alan Modra
2021-11-06 20:48:14 +10:30
parent e8f81980ce
commit 314ec7aeeb
9 changed files with 26 additions and 24 deletions

View File

@@ -31,7 +31,7 @@
#include "arsup.h"
extern int verbose;
extern int yylex (void);
static int yyerror (const char *);
static void yyerror (const char *);
%}
%union {
@@ -193,11 +193,10 @@ verbose_command:
%%
static int
static void
yyerror (const char *x ATTRIBUTE_UNUSED)
{
extern int linenumber;
printf (_("Syntax error in archive script, line %d\n"), linenumber + 1);
return 0;
}