From 6d4cdfaab71161708ba4c613b9cbdb7926fbfcb4 Mon Sep 17 00:00:00 2001 From: James R Date: Tue, 28 May 2019 15:11:37 -0700 Subject: [PATCH] Fix compiler errors The truncation handling in this one spot is okay, but the compiler isn't smart enough for it. I'm leaving it as a warning because I'd like to make a dedicated function for handling snprintf truncation in the future. --- src/Makefile.cfg | 1 + src/p_enemy.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Makefile.cfg b/src/Makefile.cfg index a0398154..8402e349 100644 --- a/src/Makefile.cfg +++ b/src/Makefile.cfg @@ -222,6 +222,7 @@ endif ifdef GCC71 WFLAGS+=-Wno-error=implicit-fallthrough WFLAGS+=-Wno-implicit-fallthrough + WFLAGS+=-Wno-error=format-truncation endif ifdef GCC80 WFLAGS+=-Wno-error=format-overflow diff --git a/src/p_enemy.c b/src/p_enemy.c index 7963286d..1795a304 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -8386,13 +8386,13 @@ void A_SPBChase(mobj_t *actor) if (actor->tracer && actor->tracer->health) { - // we're tailing a player, now's a good time to regain our damage properties - actor->flags &= ~MF_NOCLIPTHING; - fixed_t defspeed = wspeed; fixed_t range = (160*actor->tracer->scale); fixed_t cx = 0, cy =0; + // we're tailing a player, now's a good time to regain our damage properties + actor->flags &= ~MF_NOCLIPTHING; + // Play the intimidating gurgle if (!S_SoundPlaying(actor, actor->info->activesound)) S_StartSound(actor, actor->info->activesound);