Commit a483f381 by Nicolas Capens Committed by Nicolas Capens

Silence dead code warning

Clang produces: "error: code will never be executed [-Werror,-Wunreachable-code]" For code following an unconditional `break`. But it hints that: "note: silence by adding parentheses to mark code as explicitly dead" Hence the dead code can follow an "if((true)) break;" without producing the warning/error. Note that in this instance we could have just removed the dead code, but I wanted to make it clear that this is an example of an unfinished Reactor function. Bug: b/178929463 Change-Id: I1ea4dac91877fcede189d09e3953568b2813129e Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52288Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarAntonio Maiorano <amaiorano@google.com>
parent df5dee64
...@@ -211,7 +211,7 @@ TEST(ReactorUnitTests, UnfinishedFunction) ...@@ -211,7 +211,7 @@ TEST(ReactorUnitTests, UnfinishedFunction)
Int a = function.Arg<0>(); Int a = function.Arg<0>();
Int z = 4; Int z = 4;
break; // Terminate do-while early. if((true)) break; // Terminate do-while early.
Return(a + z); Return(a + z);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment