[buddy]
Get rid of some "deprecated conversion from string constant to `char*'" warnings. * examples/bddcalc/parser_.h (yyerror): Declare the format as a "const char*". * examples/bddcalc/parser.yxx (yyerror): Likewise.
This commit is contained in:
parent
919fc298ff
commit
e828783f47
3 changed files with 12 additions and 3 deletions
|
|
@ -247,7 +247,7 @@ int main(int ac, char **av)
|
|||
}
|
||||
|
||||
|
||||
void yyerror(char *fmt, ...)
|
||||
void yyerror(const char *fmt, ...)
|
||||
{
|
||||
va_list argp;
|
||||
va_start(argp,fmt);
|
||||
|
|
|
|||
|
|
@ -27,14 +27,14 @@ struct token /* BISON token data */
|
|||
#define yywrap() (1)
|
||||
|
||||
extern YYSTYPE yylval; /* Declare for flex user */
|
||||
extern void yyerror(char *,...); /* Declare for flex and bison */
|
||||
extern void yyerror(const char *,...); /* Declare for flex and bison */
|
||||
extern FILE *yyin;
|
||||
extern int yylex(void); /* Declare for bison */
|
||||
extern int yyparse(void); /* Declare for bison user */
|
||||
extern int linenum; /* Declare for error handler */
|
||||
|
||||
/* Use this instead of strdup() to avoid malloc() */
|
||||
inline char *sdup(const char *s)
|
||||
inline char *sdup(const char *s)
|
||||
{
|
||||
return strcpy(new char[strlen(s)+1], s);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue