Closed Bug 864411 Opened 7 years ago Closed 7 years ago

BytecodeEmitter.cpp:997:12: warning: enumeration value ‘MISSING’ not handled in switch [-Wswitch]

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: dholbert, Unassigned)

References

(Blocks 1 open bug)

Details

Noticed these GCC build warnings go by in my m-c build today:
{
js/src/frontend/BytecodeEmitter.cpp: In member function ‘bool js::frontend::BytecodeEmitter::isAliasedName(js::frontend::ParseNode*)’:
js/src/frontend/BytecodeEmitter.cpp:997:12: warning: enumeration value ‘MISSING’ not handled in switch [-Wswitch]

js/src/frontend/BytecodeEmitter.cpp: In function ‘bool BindNameToSlot(JSContext*, js::frontend::BytecodeEmitter*, js::frontend::ParseNode*)’:
js/src/frontend/BytecodeEmitter.cpp:1298:12: warning: enumeration value ‘MISSING’ not handled in switch [-Wswitch]
}

Looks like this enum value was added last week, here, Bug 845596:
  https://hg.mozilla.org/mozilla-central/rev/bd17606091d2#l6.30

Not sure what should happen for MISSING in these switch statements -- some strawman options, without knowing the context:

 (a) nothing (just "case Definition::MISSING: break;" to explicitly handle that enum and silence the warnings)

OR:
 (b) an assertion of some sort (if we're not expecting MISSING there)

bhackett, do you know which (if either) of those options would be appropriate here?
It seems this bug was fixed by:
  https://hg.mozilla.org/mozilla-central/rev/8d632941623d
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.