From b6f41b6ae52f4ad6cb4fe54f1ded6a1e7b4efcc9 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Mon, 26 Nov 2012 08:25:26 +0000 Subject: [PATCH] Add FORCEWARNINGS Makefile flag to prevent disabling compiler warnings within the source. git-svn-id: https://svn.eduke32.com/eduke32@3237 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/Makefile.common | 5 +++++ polymer/eduke32/build/include/compat.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/polymer/eduke32/Makefile.common b/polymer/eduke32/Makefile.common index f4fac47a3..b7e6db7b8 100644 --- a/polymer/eduke32/Makefile.common +++ b/polymer/eduke32/Makefile.common @@ -112,6 +112,7 @@ endif # RELEASE - 1 = no debugging # DEBUGANYWAY - 1 = include debug symbols even when generating release code # DISABLEINLINING - 1 = compile inline functions as extern instead of static inline +# FORCEWARNINGS - 1 = do not disable any compiler warnings within the source # KRANDDEBUG - 1 = include logging of krand() calls for debugging the demo system # EFENCE - 1 = compile with Electric Fence for malloc() debugging # OPTLEVEL - 0..3 = GCC optimization strategy @@ -122,6 +123,7 @@ RELEASE?=1 DEBUGANYWAY?=0 KRANDDEBUG?=0 DISABLEINLINING?=0 +FORCEWARNINGS?=0 EFENCE?=0 DMALLOC?=0 OPTLEVEL?=2 @@ -340,6 +342,9 @@ endif ifneq (0,$(DISABLEINLINING)) BASECOMMONFLAGS+= -DDISABLE_INLINING endif +ifneq (0,$(FORCEWARNINGS)) + BASECOMMONFLAGS+= -DFORCE_WARNINGS +endif BASELDFLAGS+= $(OPTOPT) diff --git a/polymer/eduke32/build/include/compat.h b/polymer/eduke32/build/include/compat.h index aaff436bc..4f0549e15 100644 --- a/polymer/eduke32/build/include/compat.h +++ b/polymer/eduke32/build/include/compat.h @@ -678,6 +678,7 @@ static inline char *Bstrncpyz(char *dst, const char *src, bsize_t n) } while (0) #ifdef __cplusplus +#ifndef FORCE_WARNINGS #ifdef _MSC_VER // TODO: add MSVC pragmas to disable equivalent warning, if necessary later #else @@ -697,6 +698,7 @@ static inline char *Bstrncpyz(char *dst, const char *src, bsize_t n) _Pragma("GCC diagnostic warning \"-Wformat\"") } while (0) #endif // _WIN32 #endif // _MSC_VER +#endif // FORCE_WARNINGS #endif // __cplusplus #define OSD_Printf_nowarn(fmt, ...) NOWARN(OSD_Printf, fmt, ## __VA_ARGS__)