On Friday 2014-03-28 13:41 -0700, Jeff Gilbert wrote:
> My vote is for MOZ_ASSERT_UNREACHABLE and MOZ_OPTIMIZE_FOR_UNREACHABLE.
> 
> It's really handy to have something like MOZ_ASSERT_UNREACHABLE, instead of 
> having a bunch of MOZ_ASSERT(false, "Unreachable.") lines.
> 
> Consider MOZ_ASSERT_UNREACHABLE being the same as 
> MOZ_OPTIMIZE_FOR_UNREACHABLE in non-DEBUG builds.

I agree on the first (adding a MOZ_ASSERT_UNREACHABLE), but I don't
think MOZ_OPTIMIZE_FOR_UNREACHABLE sounds dangerous enough -- the
name should make it clear that it's dangerous for the code to be
reachable (i.e., the compiler can produce undefined behavior).
MOZ_DANGEROUSLY_ASSUME_UNREACHABLE is one idea I've thought of for
that, though it's a bit of a mouthful.

-David

-- 
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                          https://www.mozilla.org/   𝄂
             Before I built a wall I'd ask to know
             What I was walling in or walling out,
             And to whom I was like to give offense.
               - Robert Frost, Mending Wall (1914)

Attachment: signature.asc
Description: Digital signature

_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to