Closed rherrmannr closed 4 years ago
-Wunreachable-code has been removed from GCC: https://gcc.gnu.org/legacy-ml/gcc-help/2011-05/msg00360.html
The unreachable code warning occurs at the react methods. They only use local variables. Thus, we cannot put the SC_UNUSED call in front of the body, as we are defining variables. One way could be creating a new block:
fun react(handle) {
SC_UNUSED(handle)
{
body
}
}
I don't like this solution at all.
Instead I've improved the check if the handle is required. As we can't test this on the build server, I'm not 100% sure if I got every case. However, this PR will avoid several unreachable-code warnings.
-WAll -WExtra and -pedantic do not detect unreachable code. We need to activate -Wunreachable-code to detect cases like this: