From b4a050b0cf2725fbca53ad80d8d6ea4a909ca8a3 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sat, 19 Apr 2014 22:42:22 +0000 Subject: [PATCH] Makefile.common: pass Clang sanitizer flags in release DEBUGANYWAY builds, too. Also, - add a static assertion to engine.c - gameexec.c: compile out an unused function in Lunatic builds git-svn-id: https://svn.eduke32.com/eduke32@4451 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/Makefile.common | 5 +++++ polymer/eduke32/build/src/engine.c | 1 + polymer/eduke32/source/gameexec.c | 2 ++ 3 files changed, 8 insertions(+) diff --git a/polymer/eduke32/Makefile.common b/polymer/eduke32/Makefile.common index 6f4c8c0f5..f8befc969 100644 --- a/polymer/eduke32/Makefile.common +++ b/polymer/eduke32/Makefile.common @@ -370,6 +370,8 @@ endif # Clang 3.2 does only supports -fsanitize=address for the AddressSanitizer ifneq ($(PLATFORM),WINDOWS) CLANG_DEBUG_FLAGS := -fsanitize=address -fsanitize=bounds,enum,float-cast-overflow,object-size +# CLANG_DEBUG_FLAGS := $(CLANG_DEBUG_FLAGS),signed-integer-overflow +# CLANG_DEBUG_FLAGS := $(CLANG_DEBUG_FLAGS),unsigned-integer-overflow endif ifneq (0,$(RELEASE)) @@ -389,6 +391,9 @@ ifneq (0,$(RELEASE)) debug+= -fomit-frame-pointer -DNDEBUG else debug+= -DDEBUGGINGAIDS + ifneq (0,$(CLANG)) + debug+= $(CLANG_DEBUG_FLAGS) + endif endif ifneq (0,$(LTO)) BASELDFLAGS+= -flto diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 78a536e1f..f4f4ef193 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -2404,6 +2404,7 @@ typedef struct static permfifotype permfifo[MAXPERMS]; static int32_t permhead = 0, permtail = 0; +EDUKE32_STATIC_ASSERT(MAXWALLSB < INT16_MAX); int16_t numscans, numbunches; static int16_t numhits; int16_t capturecount = 0; diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index c77d2474c..a91217c08 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -211,6 +211,7 @@ static inline int32_t VM_CheckSquished(void) return 1; } +#if !defined LUNATIC GAMEEXEC_STATIC GAMEEXEC_INLINE void P_ForceAngle(DukePlayer_t *p) { int32_t n = 128-(krand()&255); @@ -219,6 +220,7 @@ GAMEEXEC_STATIC GAMEEXEC_INLINE void P_ForceAngle(DukePlayer_t *p) p->return_to_center = 9; p->look_ang = p->rotscrnang = n>>1; } +#endif int32_t A_Dodge(spritetype *s) {