The complaint was that this was dead code. With gcc, -Wall -Werror makes it a compile-time error to forget an enumeration tag in a switch. I thought a static error was better than silencing it with a default and trying to catch it at runtime in a debug build with UNREACHABLE.
This was the only place in the V8 codebase where we were so defensive in a switch over an enumeration. For chains of if/else, I agree that an assert should fire if an enumeration tag is added. On Thu, Jul 23, 2009 at 8:14 PM, <[email protected]> wrote: > > http://codereview.chromium.org/159264/diff/1/3 > File src/spaces.cc (left): > > http://codereview.chromium.org/159264/diff/1/3#oldcode136 > Line 136: default: > What was the complaint by Coverity here? It is really helpful to have > default cases marked as UNREACHABLE once you start adding new entries to > the Mode enum. > > > http://codereview.chromium.org/159264 > --~--~---------~--~----~------------~-------~--~----~ v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev -~----------~----~----~----~------~----~------~--~---
