lots of unreachable breaks in illumos gate
|Assignee:||Milan Jurik||% Done:|
|Category:||lib - userland libraries|
The source code contains many unreachable breaks on different places. Unreachable code can be misleading and it is better to remove it and clean up the source code.
#1 Updated by Rich Lowe over 4 years ago
You have to be careful here to make sure that the intelligence of the lint you are using, the lint everyone else is using, and the compilers we are using can all align.
I've seen cases where it was very hard, without a lot of extra work, to make them all agree on unreachability.
Hopefully you won't hit any, though, but please do check
#3 Updated by Rich Lowe over 4 years ago
I guess I was unclear, let me try to be more clear.
The fact that code is unreachable is easy to determine visually, how lint and the compiler decide this is less obvious in cases involving exit(), panic(), and friends. With return statements it's dead simple and you're fine, in cases that involve a non-returning function, it can really truly suck to get everything to agree.
Also available in: Atom