aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-11-06 20:48:14 +1030
committerAlan Modra <amodra@gmail.com>2021-11-06 21:15:49 +1030
commit314ec7aeeb1b2e68f0d8fb9990f2335f475a6e33 (patch)
tree55e741cd404603b278fabe83cf3cb9f04eb4feb4 /gas
parente8f81980cee2d21605e60414a025f8b795147d9f (diff)
downloadfsf-binutils-gdb-314ec7aeeb1b2e68f0d8fb9990f2335f475a6e33.zip
fsf-binutils-gdb-314ec7aeeb1b2e68f0d8fb9990f2335f475a6e33.tar.gz
fsf-binutils-gdb-314ec7aeeb1b2e68f0d8fb9990f2335f475a6e33.tar.bz2
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.
Diffstat (limited to 'gas')
-rw-r--r--gas/config/bfin-parse.y7
-rw-r--r--gas/itbl-parse.y5
2 files changed, 7 insertions, 5 deletions
diff --git a/gas/config/bfin-parse.y b/gas/config/bfin-parse.y
index 980cf98..5b93d4a 100644
--- a/gas/config/bfin-parse.y
+++ b/gas/config/bfin-parse.y
@@ -25,6 +25,10 @@
#include "elf/common.h"
#include "elf/bfin.h"
+/* This file uses an old-style yyerror returning int. Disable
+ generation of a modern prototype for yyerror. */
+#define yyerror yyerror
+
#define DSP32ALU(aopcde, HL, dst1, dst0, src0, src1, s, x, aop) \
bfin_gen_dsp32alu (HL, aopcde, aop, s, x, dst0, dst1, src0, src1)
@@ -160,7 +164,6 @@ static Expr_Node *unary (Expr_Op_Type, Expr_Node *);
static void notethat (const char *, ...);
extern char *yytext;
-int yyerror (const char *);
/* Used to set SRCx fields to all 1s as described in the PRM. */
static Register reg7 = {REG_R7, 0};
@@ -177,7 +180,7 @@ void error (const char *format, ...)
as_bad ("%s", buffer);
}
-int
+static int
yyerror (const char *msg)
{
if (msg[0] == '\0')
diff --git a/gas/itbl-parse.y b/gas/itbl-parse.y
index c06b4a8..7f56c73 100644
--- a/gas/itbl-parse.y
+++ b/gas/itbl-parse.y
@@ -274,7 +274,7 @@ FIXME! hex is ambiguous with any digit
static int sbit, ebit;
static struct itbl_entry *insn=0;
-static int yyerror (const char *);
+static void yyerror (const char *);
%}
@@ -449,9 +449,8 @@ value:
;
%%
-static int
+static void
yyerror (const char *msg)
{
printf ("line %d: %s\n", insntbl_line, msg);
- return 0;
}