coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/2] maint: change inappropriate uses of unreachable()


From: Collin Funk
Subject: Re: [PATCH 2/2] maint: change inappropriate uses of unreachable()
Date: Mon, 17 Aug 2026 21:17:15 -0700
User-agent: Gnus/5.13 (Gnus v5.13)

PƔdraig Brady <P@draigBrady.com> writes:

> Uses of unreachable() should be provably unreachable, and trivially so.
> Trivial cases: e.g. after error(NON_ZERO, ...) etc,
> or a fully handled switch on enum (proved with -Wswitch-enum).

That makes sense.

> Note unreachable() can be defined to exit with -funreachable-traps,
> but it's better to use standard build options and distinguish the
> different classes of "unreachable" in code.  Also clang (22) doesn't
> seem to support the -funreachable-traps option.

I wanted to mention that previously but forgot the name of that option.
I doubt most people running ./configure know (nor should they need to
know) about it.

The patch looks good to me.

Thanks,
Collin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]