Closed Bug 713560 Opened 13 years ago Closed 13 years ago

MOZ_STATIC_ASSERT doesn't use 'reason' as often as it could

Categories

(Core :: MFBT, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla12

People

(Reporter: zwol, Assigned: Waldo)

Details

MOZ_STATIC_ASSERT(cond, reason) is #defined to the C++11 static_assert() whenever available; due to the variety of compilers we support, there are four separate #defines that do that, under a bunch of #ifdefs, in the present version of the file: <http://hg.mozilla.org/mozilla-central/file/9f29daaecbcc/mfbt/Assertions.h#l63>

Only one of those four definitions reads

#      define MOZ_STATIC_ASSERT(cond, reason)    static_assert((cond), reason)

the other three are

#      define MOZ_STATIC_ASSERT(cond, reason)    static_assert((cond), #cond)

making no use of 'reason'. This seems wrong.
Hmm, yeah, that was wrong, wasn't it.  Thanks for pointing it out, fixed here (seems typo-land enough that it's not worth wasting someone's time reviewing it):

https://hg.mozilla.org/integration/mozilla-inbound/rev/3b3f1c6d6983
Assignee: nobody → jwalden+bmo
Status: NEW → ASSIGNED
OS: Mac OS X → All
Hardware: x86 → All
Target Milestone: --- → mozilla12
https://hg.mozilla.org/mozilla-central/rev/3b3f1c6d6983
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.