I have an older program that was built with clang via CFLAGS=”-Wunreachable-code” and it’s displaying some warnings on certain switch(), on a break; where it’s saying it’s ‘will never be executed’, is it safe to simply remove the unreachable code, or is -Wunreachable-code beta in nature?
Specifically, it’s giving warnings on a few functions, ie: return -1 after a previous return, and breaks inside of a switch()
Read the code, understand it, and if the code marked unreachable really is unreachable and it isn’t unreachable because of a logic error, then you can just remove it. If you haven’t read the code and understood it, then it isn’t safe to modify it no matter what the compiler says.