mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-10-13 20:27:24 +00:00
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 inf6bb7162- compiler warning. Then the break was added inc6dc96f3.
This commit is contained in:
+2
-2
@@ -775,7 +775,7 @@ void UnityAssertFloatSpecial(const _UF actual,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
/*break // unreachable code */;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_trait != should_be_trait)
|
if (is_trait != should_be_trait)
|
||||||
@@ -938,7 +938,7 @@ void UnityAssertDoubleSpecial(const _UD actual,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
/*break // unreachable code*/;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_trait != should_be_trait)
|
if (is_trait != should_be_trait)
|
||||||
|
|||||||
Reference in New Issue
Block a user