1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-22 21:23:10 +02:00

b2/: new diagnostic function yywarnf

This commit is contained in:
Werner Almesberger 2012-04-28 22:38:06 -03:00
parent 8aa94edd2f
commit eabe0dc910
2 changed files with 13 additions and 0 deletions

View File

@ -16,6 +16,7 @@
void parse_hierarchy(void); void parse_hierarchy(void);
void parse_characteristics(void); void parse_characteristics(void);
void yywarnf(const char *fmt, ...);
void yyerrorf(const char *fmt, ...); void yyerrorf(const char *fmt, ...);
void yyerror(const char *s); void yyerror(const char *s);

View File

@ -87,6 +87,18 @@ ID [-_A-Za-z0-9()+./]
%% %%
void yywarnf(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
fprintf(stderr, "%d: warning: ", lineno);
vfprintf(stderr, fmt, ap) ;
fprintf(stderr, "\n");
va_end(ap);
}
void yyerrorf(const char *fmt, ...) void yyerrorf(const char *fmt, ...)
{ {
va_list ap; va_list ap;