[PATCH vkd3d] vkd3d: Add a function to mark unreachable code.
Henri Verbeet
hverbeet at gmail.com
Thu Apr 14 06:42:11 CDT 2022
On Thu, 14 Apr 2022 at 13:00, Giovanni Mascellani
<gmascellani at codeweavers.com> wrote:
> From the point of view of the compiler, assert(0) is not really
> different from vkd3d_unreachable(NULL): nothing tells the compiler that
> control will never ever reach it; if it happens, the compiler will print
> a message and abort(). The advantage of vkd3d_unreachable() is that the
> compiler won't try to tell you "Hey, you didn't write your return
> statement!" in places where it doesn't make any sense (because it's
> marked "noreturn").
For what it's worth, note that assert() is effectively compiled out
when NDEBUG is defined.
More information about the wine-devel
mailing list