commit 04b3480cb426c38028b895d6ab38cd108a9aefae
parent 195cc1977d51217abaf20467714bc78c320221cd
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Sun, 19 Jul 2015 11:27:16 +0200
Join conditions in warn_helper()
Diffstat:
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/cc1/error.c b/cc1/error.c
@@ -17,16 +17,18 @@ warn_helper(int flag, char *fmt, va_list va)
{
if (flag == 0)
return;
- if (flag < 0)
- failure = 1;
fprintf(stderr, "%s:%u: %s: ",
input->fname, input->nline,
(flag < 0) ? "error" : "warning");
vfprintf(stderr, fmt, va);
putc('\n', stderr);
- if (flag < 0 && nerrors++ == MAXERRNUM) {
- fputs("too many errors\n", stderr);
- exit(1);
+
+ if (flag < 0) {
+ failure = 1;
+ if (nerrors++ == MAXERRNUM) {
+ fputs("too many errors\n", stderr);
+ exit(1);
+ }
}
}