From a4cfd86f47991d61e095ec1287eeb4a758bc8e16 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 21 Feb 2020 20:23:08 +0100 Subject: [PATCH] Reporter: add [[noreturn]] attribute to several methods MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes this compiler warning: src/digest.cc: In function ‘EVP_MD_CTX* hash_init(HashAlgorithm)’: src/digest.cc:44:26: warning: ‘md’ may be used uninitialized in this function [-Wmaybe-uninitialized] if ( ! EVP_DigestInit_ex(c, md, NULL) ) ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~ --- src/Reporter.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Reporter.h b/src/Reporter.h index 6e364dce8f..cdb0bc13e9 100644 --- a/src/Reporter.h +++ b/src/Reporter.h @@ -66,11 +66,11 @@ public: // Report a fatal error. Bro will terminate after the message has been // reported. - void FatalError(const char* fmt, ...) FMT_ATTR; + [[noreturn]] void FatalError(const char* fmt, ...) FMT_ATTR; // Report a fatal error. Bro will terminate after the message has been // reported and always generate a core dump. - void FatalErrorWithCore(const char* fmt, ...) FMT_ATTR; + [[noreturn]] void FatalErrorWithCore(const char* fmt, ...) FMT_ATTR; // Report a runtime error in evaluating a Bro script expression. This // function will not return but raise an InterpreterException. @@ -97,7 +97,7 @@ public: // Report an internal program error. Bro will terminate with a core // dump after the message has been reported. - void InternalError(const char* fmt, ...) FMT_ATTR; + [[noreturn]] void InternalError(const char* fmt, ...) FMT_ATTR; // Report an analyzer error. That analyzer will be set to not process // any further input, but Bro otherwise continues normally.