Thread (1 message) 1 message, 1 author, 2020-12-16

Re: [PATCH 2/2] style: do not "break" in switch() after "return"

From: Junio C Hamano <hidden>
Date: 2020-12-16 00:36:09

Junio C Hamano [off-list ref] writes:
Ævar Arnfjörð Bjarmason  [off-list ref] writes:
quoted
Remove this unreachable code. It was found by SunCC, it's found by a
non-fatal warning emitted by SunCC. It's one of the things it's more
vehement about than GCC & Clang.
This is a borderline Meh to me.

I am even tempted to suggest that, unless all other case arms
return, iow, if there is even a single arm that breaks, it may even
be more future-proof to end any and all case arms that do not
fall-thru to consistently end with break.

If there is some way to fix the compiler, that may be preferrable,
but as I said, this is borderline Meh and I do not care too deeply
either way.

Thanks.
Heh, this patch cleanly applies even to the tip of 'maint', which
means it is not a new issue at all.  Is this caused by more recent
SunCC than you used in the past?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help