summaryrefslogtreecommitdiffstats
path: root/src/message.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2020-08-19 18:33:40 (GMT)
committerGitHub <noreply@github.com>2020-08-19 18:33:40 (GMT)
commit61e31b90708d501904665f85cfd3ea1b826b7afa (patch)
tree71cf593530671c4584550e9ddfa228e56ce3c8e8 /src/message.cpp
parentb6a1dcf9f604707015275b86bcfe0e008cbde248 (diff)
parenta3410621bdb09e07728faaaf4ebe09f27953c5be (diff)
downloadDoxygen-61e31b90708d501904665f85cfd3ea1b826b7afa.zip
Doxygen-61e31b90708d501904665f85cfd3ea1b826b7afa.tar.gz
Doxygen-61e31b90708d501904665f85cfd3ea1b826b7afa.tar.bz2
Merge pull request #7972 from albert-github/feature/issue_7970
issue #7970 Doxygen doesn't stop on errors
Diffstat (limited to 'src/message.cpp')
-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, ...)