aboutsummaryrefslogtreecommitdiffstats
path: root/util/system/err.cpp
diff options
context:
space:
mode:
authorthegeorg <thegeorg@yandex-team.ru>2022-02-19 13:10:22 +0300
committerthegeorg <thegeorg@yandex-team.ru>2022-02-19 13:10:22 +0300
commit7d7953cb46099a2517822b5832d49351eeecbde1 (patch)
tree36870cca6282667dacc5c0385c42a76dd00cf1f3 /util/system/err.cpp
parent709f0db82ea5003ac1f26d3206f1904ec17bbe92 (diff)
downloadydb-7d7953cb46099a2517822b5832d49351eeecbde1.tar.gz
Properly attribute err.h replacements as [[noreturn]]
ref:e86419934a6858c3f36f45e15d1e42cc501ea395
Diffstat (limited to 'util/system/err.cpp')
-rw-r--r--util/system/err.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/util/system/err.cpp b/util/system/err.cpp
index 5573ea1ee9..e2e5d8c9fd 100644
--- a/util/system/err.cpp
+++ b/util/system/err.cpp
@@ -5,6 +5,7 @@
#include <util/generic/scope.h>
+#include <util/system/compat.h>
#include <util/stream/printf.h>
#include <util/stream/output.h>
@@ -52,12 +53,12 @@ void warnx(const char* fmt, ...) {
va_end(args);
}
-void verr(int status, const char* fmt, va_list args) {
+[[noreturn]] void verr(int status, const char* fmt, va_list args) {
vwarn(fmt, args);
- exit(status);
+ std::exit(status);
}
-void err(int status, const char* fmt, ...) {
+[[noreturn]] void err(int status, const char* fmt, ...) {
va_list args;
va_start(args, fmt);
@@ -65,12 +66,12 @@ void err(int status, const char* fmt, ...) {
va_end(args);
}
-void verrx(int status, const char* fmt, va_list args) {
+[[noreturn]] void verrx(int status, const char* fmt, va_list args) {
vwarnx(fmt, args);
- exit(status);
+ std::exit(status);
}
-void errx(int status, const char* fmt, ...) {
+[[noreturn]] void errx(int status, const char* fmt, ...) {
va_list args;
va_start(args, fmt);