From 7a0875f4f3adacdcedd472742ad827b9f49e1c4d Mon Sep 17 00:00:00 2001 From: jsalling <salling@utexas> Date: Sat, 27 Feb 2016 10:26:04 -0600 Subject: [PATCH] Fix unreachable code in Unity on fully covered switch statements The clang compiler warns here with -Wunreachable-code The enum's switch statement covers all cases, so default is unused Leave the break in the code as a comment, to be more clear The history is this default case was added in f6bb7162 - compiler warning. Then the break was added in c6dc96f3. --- src/unity.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/unity.c b/src/unity.c index 05fa6ea..91edec8 100644 --- a/src/unity.c +++ b/src/unity.c @@ -775,7 +775,7 @@ void UnityAssertFloatSpecial(const _UF actual, break; default: - break; + /*break // unreachable code */; } if (is_trait != should_be_trait) @@ -938,7 +938,7 @@ void UnityAssertDoubleSpecial(const _UD actual, break; default: - break; + /*break // unreachable code*/; } if (is_trait != should_be_trait)