-/* Copyright (C) 2001-2015 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2023 Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support (steve@cygnus.com).
This file is part of GNU binutils.
%{
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
static char writecode;
static char *it;
static char *names[] = {" ","[n]","[n][m]"};
static char *pnames[]= {"","*","**"};
-static int yyerror (char *s);
+static void yyerror (const char *s);
extern int yylex (void);
%}
break;
case 'g':
printf("\tchecksum(ffile,raw, idx, IT_%s_CODE);\n", it);
-
+ /* Fall through. */
case 'i':
-
case 'o':
case 'c':
printf("}\n");
}
+
+ free (it);
}
;
printf("\tprintf(\"repeat %%d\\n\", %s);\n",$3);
if (rdepth==2)
printf("\tprintf(\"repeat %%d\\n\", %s[n]);\n",$3);
+ /* Fall through. */
case 'i':
case 'g':
case 'o':
it_field_list ')'
{
+ free (repeat);
+
repeat = oldrepeat;
oldrepeat =0;
rdepth--;
printf("\tif (%s) {\n", $3);
break;
}
+
+ free ($3);
}
it_field_list ')'
else abort();
break;
}
+
+ free (desc);
+ free (id);
}
;
attr_id:
'(' NAME ')' { $$ = $2; }
- | { $$ = "dummy";}
+ | { $$ = strdup ("dummy");}
;
enums:
case 'c':
printf("if (ptr->%s%s == %s) { tabout(); printf(\"%s\\n\");}\n", name, names[rdepth],$4,$3);
}
+
+ free ($3);
+ free ($4);
}
;
return 0;
}
-static int
-yyerror (char *s)
+static void
+yyerror (const char *s)
{
fprintf(stderr, "%s\n" , s);
- return 0;
}