Re: [PATCH] config.mak.dev: enable -Wunreachable-code
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 14, 2025, 17:40 UTC
- Message-ID
- <xmqqr02zfr3r.fsf@gitster.g>
- In-Reply-To
- <xmqqv7sbh698.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 18 quoted lines
> Jeff King <peff@peff.net> writes:
>
>> -- >8 --
>> Subject: [PATCH] run-command: use errno to check for sigfillset() error
>>
>> Since enabling -Wunreachable-code, builds with clang on macOS now fail,
>> complaining that the die_errno() call in:
>>
>> if (sigfillset(&all))
>> die_errno("sigfillset");
>>
>> is unreachable. On that platform the manpage documents that sigfillset()
>> always returns success, and presumably the implementation is a macro or
>> inline function that does so in a way that is transparent to the
>> compiler.
>
> Would it work to instead do this here
> ...I forgot to say a more important thing. Between the "let's excempt developers on macOS" and the "let's see how far we can go with the warning turned on everywhere and wack-a-mole this particular one with errno check" patches, I prefer the latter at least for a short term.
Thanks.