On 2025-09-18 14:48, Collin Funk wrote:
What is the difference between
affirm (false) and unreachable ()?
There's no difference if you define NDEBUG, but in the normal case where
if NDEBUG is not defined, affirm (false) is like assert (false).
I find unreachable () to convey the meaning much better.
Me too.
I suspect that coreutils' uses of 'affirm (false)' predate the
introduction 'unreachable'. I'd also prefer to change them to
'unreachable ()'. However, we have yet to hear from any fans of 'assert'.