Add --quiet option to supress all diagnostic output

This commit is contained in:
Matt Pharr
2012-02-06 06:24:10 -08:00
parent a9ec745275
commit 724a843bbd
5 changed files with 24 additions and 7 deletions

View File

@@ -91,7 +91,12 @@ extern int yylex(YYSTYPE *, SourcePos *);
extern char *yytext;
void yyerror(const char *s) { fprintf(stderr, "Parse error: %s\n", s); }
void yyerror(const char *s) {
if (!g->quiet) {
++m->errorCount;
fprintf(stderr, "Parse error: %s\n", s);
}
}
static void lAddDeclaration(DeclSpecs *ds, Declarator *decl);
static void lAddFunctionParams(Declarator *decl);