Re: [PATCH 2/2] style: do not "break" in switch() after "return"
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 16, 2020, 00:35 UTC
- Message-ID
- <xmqqpn3a611j.fsf@gitster.c.googlers.com>
- In-Reply-To
- <xmqqtusm618e.fsf@gitster.c.googlers.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 18 quoted lines
> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes: > >> 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?