Implement a single nbErrors counter inside generic diagnostic code

This commit is contained in:
Rangi42
2025-07-26 12:48:25 -04:00
parent ac632d9223
commit 92acb6e547
10 changed files with 61 additions and 81 deletions

View File

@@ -547,7 +547,7 @@ static void
}
static bool processFilename(char const *name, char const *outputName) {
resetErrors();
warnings.nbErrors = 0;
bool inputStdin = !strcmp(name, "-");
if (inputStdin && !outputName) {
@@ -901,7 +901,7 @@ int main(int argc, char *argv[]) {
fatalWithUsage("If `-o` is set then only a single input file may be specified");
}
bool failed = anyErrors();
bool failed = warnings.nbErrors > 0;
do {
failed |= processFilename(*argv, outputFilename);
} while (*++argv);