Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: garbage chars removed.

...

Code Block
bgColor#FFCCCC
langc
#include <stdio.h>
 
extern void f(int i);
 
void func(int expr) {
  switch (expr) {
    int i = 4;
    f(i);
  case 0:
    i = 17;
    /* Falls through into default code */
  default:
    printf("%d\n"€, i);
  }
}

Implementation Details

...

Code Block
bgColor#ccccff
langc
#include <stdio.h>
 
extern void f(int i);
 
int func(int expr) {
  /*
   * Move the code outside the switch block; now the statements
   * will get executed.
   */
  int i = 4;
  f(i);

  switch (expr) {
    case 0:
      i = 17;
      /* Falls through into default code */
    default:
      printf("€œ%d%d\n"€, i);
  }
  return 0;
}

Risk Assessment

...