Reporter: add [[noreturn]] attribute to several methods

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) )
         ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
This commit is contained in:
Max Kellermann 2020-02-21 20:23:08 +01:00
parent 38b25cf38d
commit a4cfd86f47

View file

@ -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.