diff --git a/CMakeLists.txt b/CMakeLists.txt index 71f876af..dc9b053f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -122,6 +122,10 @@ if (MSVC) add_definitions("/wd4244") # disable "conversion from .. to .., possible loss of data" warning add_definitions("/wd4018") # disable "signed/unsigned mismatch" warning add_definitions("/wd4200") # disable "nonstandard extension used: zero-sized array in struct/union" warning + add_definitions("/wd4264") # disable "conversion from 'size_t' to 'int', possible loss of data" warning + add_definitions("/wd4267") # disable "conversion from 'size_t' to 'int', possible loss of data" warning + add_definitions("/wd4305") # disable "truncation from 'double' to 'float'" warning + endif (MSVC) # 10.9: minimum version that supports unordered_map 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 30fd15c5..4c611d36 100644 --- a/include/qbsp/util.hh +++ b/include/qbsp/util.hh @@ -35,7 +35,7 @@ extern const char *rgszWarnings[cWarnings]; void *AllocMem(int Type, int cSize, bool fZero); 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, ...);