summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Brenner <olsner@gmail.com>2017-09-24 00:09:47 +0200
committerPeter Johnson <johnson.peter@gmail.com>2017-09-23 15:09:47 -0700
commit85dad85f7c282967176dec38835dedaf1322a25f (patch)
tree894313a65dbb1d7ade50d3a9fa2e8b799eead9e8
parent4808260d62ab0a1e2b9b9e7ec99873cdb6e2203c (diff)
downloadyasm-85dad85f7c282967176dec38835dedaf1322a25f.tar.gz
Only print 'warnings treated as errors' if there were warnings (#75)
This prints it as an additional error for the line that generated the first warning.
-rw-r--r--libyasm/errwarn.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/libyasm/errwarn.c b/libyasm/errwarn.c
index d51a0deb..18958db9 100644
--- a/libyasm/errwarn.c
+++ b/libyasm/errwarn.c
@@ -492,14 +492,6 @@ yasm_errwarns_output_all(yasm_errwarns *errwarns, yasm_linemap *lm,
const char *filename, *xref_filename;
unsigned long line, xref_line;
- /* If we're treating warnings as errors, tell the user about it. */
- if (warning_as_error && warning_as_error != 2) {
- print_error("", 0,
- yasm_gettext_hook(N_("warnings being treated as errors")),
- NULL, 0, NULL);
- warning_as_error = 2;
- }
-
/* Output error/warnings. */
SLIST_FOREACH(we, &errwarns->errwarns, link) {
/* Output error/warning */
@@ -514,7 +506,17 @@ yasm_errwarns_output_all(yasm_errwarns *errwarns, yasm_linemap *lm,
print_error(filename, line, we->msg, xref_filename, xref_line,
we->xrefmsg);
else
+ {
print_warning(filename, line, we->msg);
+
+ /* If we're treating warnings as errors, tell the user about it. */
+ if (warning_as_error && warning_as_error != 2) {
+ const char *msg =
+ yasm_gettext_hook(N_("warnings being treated as errors"));
+ print_error(filename, line, msg, NULL, 0, NULL);
+ warning_as_error = 2;
+ }
+ }
}
}