Fix some usually disabled compiler warnings (#1286)

* Fixes from temporarily re-enabling more compiler warnings

* More edits suggested by cppcheck

* Fix hanging on append_yylval_string

* Fix FOR loop increment
This commit is contained in:
Sylvie
2024-01-18 14:47:20 -05:00
committed by GitHub
parent d179f3ed28
commit 66fd5a7062
13 changed files with 36 additions and 31 deletions

View File

@@ -372,22 +372,20 @@ void warning(enum WarningID id, char const *fmt, ...)
switch (warningState(id)) {
case WARNING_DISABLED:
return;
break;
case WARNING_ENABLED:
printDiag(fmt, args, "warning: ", ": [-W%s]\n ", flag);
break;
case WARNING_ERROR:
printDiag(fmt, args, "error: ", ": [-Werror=%s]\n ", flag);
va_end(args);
return;
break;
case WARNING_DEFAULT:
unreachable_();
// Not reached
case WARNING_ENABLED:
break;
}
printDiag(fmt, args, "warning: ", ": [-W%s]\n ", flag);
va_end(args);
}