From 314ec7aeeb1b2e68f0d8fb9990f2335f475a6e33 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Sat, 6 Nov 2021 20:48:14 +1030 Subject: 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. --- ld/deffilep.y | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'ld') diff --git a/ld/deffilep.y b/ld/deffilep.y index e58d0e0..6bed643 100644 --- a/ld/deffilep.y +++ b/ld/deffilep.y @@ -102,7 +102,7 @@ static void def_version (int, int); static void def_directive (char *); static void def_aligncomm (char *str, int align); static int def_parse (void); -static int def_error (const char *); +static void def_error (const char *); static int def_lex (void); static int lex_forced_token = 0; @@ -1261,12 +1261,11 @@ def_aligncomm (char *str, int align) } } -static int +static void def_error (const char *err) { einfo ("%P: %s:%d: %s\n", def_filename ? def_filename : "", linenumber, err); - return 0; } -- cgit v1.1