#include "arsup.h"
 extern int verbose;
 extern int yylex (void);
-static int yyerror (const char *);
+static void yyerror (const char *);
 %}
 
 %union {
 
 %%
 
-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;
 }
 
 static int d_is_dll;
 static int d_is_exe;
 
-int
+void
 yyerror (const char * err ATTRIBUTE_UNUSED)
 {
   /* xgettext:c-format */
   non_fatal (_("Syntax error in def file %s:%d"), def_file, linenumber);
-
-  return 0;
 }
 
 void
 
 extern void def_stacksize (int, int);
 extern void def_version (int, int);
 extern int  yyparse (void);
-extern int  yyerror (const char *);
+extern void yyerror (const char *);
 extern int  yylex (void);
 
 extern int yydebug;
 
 }
 
 
-int
-yyerror (const char *s, ...)
+static void
+mc_error (const char *s, ...)
 {
   va_list argp;
   va_start (argp, s);
   show_msg ("parser", s, argp);
   va_end (argp);
-  return 1;
+}
+
+void
+yyerror (const char *s)
+{
+  mc_error (s);
 }
 
 static unichar *
        yylval.ustr = get_diff (input_stream_pos, start_token);
        return MCIDENT;
       }
-    yyerror ("illegal character 0x%x.", ch);
+    mc_error ("illegal character 0x%x.", ch);
   }
   return -1;
 }
 
 static char *names[] = {" ","[n]","[n][m]"};
 static char *pnames[]= {"","*","**"};
 
-static int yyerror (char *s);
+static void yyerror (const char *s);
 extern int yylex (void);
 %}
 
 return 0;
 }
 
-static int
-yyerror (char *s)
+static void
+yyerror (const char *s)
 {
   fprintf(stderr, "%s\n" , s);
-  return 0;
 }
 
 mc_node *mc_add_node (void);
 
 /* Standard yacc/flex stuff.  */
-int yyerror (const char *, ...);
+void yyerror (const char *);
 int yylex (void);
 int yyparse (void);
 
 
 #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)
 
 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};
     as_bad ("%s", buffer);
 }
 
-int
+static int
 yyerror (const char *msg)
 {
   if (msg[0] == '\0')
 
 
 static int sbit, ebit;
 static struct itbl_entry *insn=0;
-static int yyerror (const char *);
+static void yyerror (const char *);
 
 %}
 
        ;
 %%
 
-static int
+static void
 yyerror (const char *msg)
 {
   printf ("line %d: %s\n", insntbl_line, msg);
-  return 0;
 }
 
 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;
     }
 }
 
-static int
+static void
 def_error (const char *err)
 {
   einfo ("%P: %s:%d: %s\n",
         def_filename ? def_filename : "<unknown-file>", linenumber, err);
-  return 0;
 }