1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-09-29 03:09:49 +03:00

b2/new function yywarn; make yyerror reuse yyerrorf

This commit is contained in:
Werner Almesberger 2012-05-31 12:13:06 -03:00
parent 52e58cccbe
commit 2239440ef1
2 changed files with 8 additions and 2 deletions

View File

@ -34,6 +34,7 @@ void parse_kicad_bom(const char *name);
void parse_symbols(const char *name); void parse_symbols(const char *name);
void yywarnf(const char *fmt, ...); void yywarnf(const char *fmt, ...);
void yywarn(const char *s);
void __attribute__((noreturn)) yyerrorf(const char *fmt, ...); void __attribute__((noreturn)) yyerrorf(const char *fmt, ...);
void __attribute__((noreturn)) yyerror(const char *s); void __attribute__((noreturn)) yyerror(const char *s);

View File

@ -197,6 +197,12 @@ void yywarnf(const char *fmt, ...)
} }
void yywarn(const char *s)
{
yywarnf("%s", s);
}
void __attribute__((noreturn)) yyerrorf(const char *fmt, ...) void __attribute__((noreturn)) yyerrorf(const char *fmt, ...)
{ {
va_list ap; va_list ap;
@ -212,8 +218,7 @@ void __attribute__((noreturn)) yyerrorf(const char *fmt, ...)
void __attribute__((noreturn)) yyerror(const char *s) void __attribute__((noreturn)) yyerror(const char *s)
{ {
fprintf(stderr, "%s:%d: %s\n", file_name, lineno, s); yyerrorf("%s", s);
exit(1);
} }