Add --werror flag to treat warnings as errors.

The specific need for it was so that tests in tests_errors
can test to see if a desired diagnostic warning is issued
(like ptrcast-lose-info does.)
This commit is contained in:
Matt Pharr
2011-11-30 05:51:53 -08:00
parent 6b9b7437ed
commit c995902796
5 changed files with 12 additions and 3 deletions

View File

@@ -291,7 +291,9 @@ Warning(SourcePos p, const char *fmt, ...) {
va_list args;
va_start(args, fmt);
lPrint("Warning", p, fmt, args);
lPrint(g->warningsAsErrors ? "Error" : "Warning", p, fmt, args);
if (g->warningsAsErrors)
++m->errorCount;
va_end(args);
}