From 56a862fded43b528eadc232d37a8684b48ef702c Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Fri, 13 Mar 2020 16:26:33 -0400 Subject: diag: Make the -warn flag part of the cmdline --- diag.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'diag.c') diff --git a/diag.c b/diag.c index bdbf98e..f43ed2e 100644 --- a/diag.c +++ b/diag.c @@ -47,12 +47,14 @@ void bfs_verror(const struct cmdline *cmdline, const char *format, va_list args) } void bfs_vwarning(const struct cmdline *cmdline, const char *format, va_list args) { - int error = errno; + if (cmdline->warn) { + int error = errno; - bfs_warning_prefix(cmdline); + bfs_warning_prefix(cmdline); - errno = error; - cvfprintf(cmdline->cerr, format, args); + errno = error; + cvfprintf(cmdline->cerr, format, args); + } } void bfs_error_prefix(const struct cmdline *cmdline) { -- cgit v1.2.3