Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH 4/4] Suppress "statement not reached" warnings under Sun Studio

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:52:41

Ævar Arnfjörð Bjarmason [off-list ref] writes:
That would make that warning go away, but I don't know if that changes
the semantics of the code. I was aiming not to change any code, just
to squash spurious warnings under Sun Studio.
Well, earlier we skipped "if it is NUL return 1 and otherwise make sure it
is a directory separator" check and went directly into whatever happens
after we see a directory separator. The patch causes the same without goto.

If the code is too complex to confuse not so bright compilers, it is
likely to confuse no so bright humans as well, and rewriting the logic in
a more straightforward way to help humans is independently a good thing.

I am not particularly interested in squashing spurious warnings, but if it
falls out of a side effect of helping humans, I wouldn't object to it.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help