From 363c92ed534d5cffe164079359b62a0768bc0f80 Mon Sep 17 00:00:00 2001 From: Tycho Date: Wed, 19 Mar 2014 12:06:12 -0700 Subject: [PATCH] Added unreachable lines backit prtected by preprocessor guards --- src/Defines.h | 4 ++++ src/Scoreboard.cpp | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/src/Defines.h b/src/Defines.h index 7f7a2eeb1..1a8b3fa4a 100644 --- a/src/Defines.h +++ b/src/Defines.h @@ -290,6 +290,10 @@ inline AString BlockFaceToString(eBlockFace a_BlockFace) case BLOCK_FACE_ZP: return "BLOCK_FACE_ZP"; case BLOCK_FACE_NONE: return "BLOCK_FACE_NONE"; } + // clang optimisises this line away then warns that it has done so. + #if !defined(__clang__) + return Printf("Unknown BLOCK_FACE: %d", a_BlockFace); + #endif } diff --git a/src/Scoreboard.cpp b/src/Scoreboard.cpp index cfeb1d619..4c89ce265 100644 --- a/src/Scoreboard.cpp +++ b/src/Scoreboard.cpp @@ -30,7 +30,13 @@ AString cObjective::TypeToString(eType a_Type) case otStatBlockMine: return "stat.mineBlock"; case otStatEntityKill: return "stat.killEntity"; case otStatEntityKilledBy: return "stat.entityKilledBy"; + + // clang optimisises this line away then warns that it has done so. + #if !defined(__clang__) + default: return ""; + #endif } + }