Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
bgColor#ffcccc
enum et1 {
  E_A,
  E_B
};

int i1 = 5;

switch(static_cast<et1>(i1)) {
  case E_A:
    /* some action A */
  case E_B:
    /* some action B */
}

GCC 4.4.3 will execute case E_A, and Microsoft VS2008 will execute neither case, in this noncompliant example.

Compliant Code Example (Switch-statement)

...