summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2020-08-19 13:58:52 (GMT)
committeralbert-github <albert.tests@gmail.com>2020-08-19 13:58:52 (GMT)
commita3410621bdb09e07728faaaf4ebe09f27953c5be (patch)
tree71cf593530671c4584550e9ddfa228e56ce3c8e8
parentb6a1dcf9f604707015275b86bcfe0e008cbde248 (diff)
downloadDoxygen-a3410621bdb09e07728faaaf4ebe09f27953c5be.zip
Doxygen-a3410621bdb09e07728faaaf4ebe09f27953c5be.tar.gz
Doxygen-a3410621bdb09e07728faaaf4ebe09f27953c5be.tar.bz2
issue #7970 Doxygen doesn't stop on errors
Routines doing their own formatting should also stop when `WARN_AS_ERROR` is set.
-rw-r--r--src/message.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/message.cpp b/src/message.cpp
index 37204f5..984a00f 100644
--- a/src/message.cpp
+++ b/src/message.cpp
@@ -161,6 +161,18 @@ static void format_warn(const char *file,int line,const char *text)
}
}
+static void handle_warn_as_error(void)
+{
+ static bool warnAsError = Config_getBool(WARN_AS_ERROR);
+ if (warnAsError)
+ {
+ std::unique_lock<std::mutex> lock(g_mutex);
+ QCString msgText = " (warning treated as error, aborting now)\n";
+ fwrite(msgText.data(),1,msgText.length(),warnFile);
+ exit(1);
+ }
+}
+
static void do_warn(bool enabled, const char *file, int line, const char *prefix, const char *fmt, va_list args)
{
if (!enabled) return; // warning type disabled
@@ -230,6 +242,7 @@ void warn_uncond(const char *fmt, ...)
va_start(args, fmt);
vfprintf(warnFile, (QCString(warning_str) + fmt).data(), args);
va_end(args);
+ handle_warn_as_error();
}
void err(const char *fmt, ...)
@@ -238,6 +251,7 @@ void err(const char *fmt, ...)
va_start(args, fmt);
vfprintf(warnFile, (QCString(error_str) + fmt).data(), args);
va_end(args);
+ handle_warn_as_error();
}
extern void err_full(const char *file,int line,const char *fmt, ...)