From 8beda9a03918dcd217818f428a9175c3e6bfbd03 Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Thu, 26 Aug 2021 20:22:09 -0600 Subject: [PATCH] common, qbsp: make Error() noreturn --- common/cmdlib.cc | 2 +- common/threads.cc | 2 +- include/common/cmdlib.hh | 2 +- include/qbsp/util.hh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/cmdlib.cc b/common/cmdlib.cc index 65c8c6c2..7dc1b61a 100644 --- a/common/cmdlib.cc +++ b/common/cmdlib.cc @@ -57,7 +57,7 @@ char archivedir[1024]; * For abnormal program terminations * ================= */ -void +[[noreturn]] void Error(const char *error, ...) { va_list argptr; diff --git a/common/threads.cc b/common/threads.cc index 3584e439..b6b384a0 100644 --- a/common/threads.cc +++ b/common/threads.cc @@ -12,7 +12,7 @@ * thread/logging code. Error() would normally be defined in * either common/cmdlib.h or qbsp/qbsp.h. */ -void Error(const char *error, ...) +[[noreturn]] void Error(const char *error, ...) __attribute__((format(printf,1,2),noreturn)); /* Make the locks no-ops if we aren't running threads */ diff --git a/include/common/cmdlib.hh b/include/common/cmdlib.hh index 690128e9..b2f203ec 100644 --- a/include/common/cmdlib.hh +++ b/include/common/cmdlib.hh @@ -81,7 +81,7 @@ char *ExpandPathAndArchive(char *path); double I_FloatTime(void); -void Error(const char *error, ...) +[[noreturn]] void Error(const char *error, ...) __attribute__((format(printf,1,2),noreturn)); int CheckParm(const char *check); diff --git a/include/qbsp/util.hh b/include/qbsp/util.hh index 61a96734..50ce6a79 100644 --- a/include/qbsp/util.hh +++ b/include/qbsp/util.hh @@ -42,7 +42,7 @@ void FreeAllMem(void); void PrintMem(void); void Message(int MsgType, ...); -void Error(const char *error, ...) +[[noreturn]] void Error(const char *error, ...) __attribute__((format(printf,1,2),noreturn)); int q_snprintf(char *str, size_t size, const char *format, ...);