Print this page
10703 smatch unreachable code checking needs reworking
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/tools/smatch/src/check_unreachable.c
          +++ new/usr/src/tools/smatch/src/check_unreachable.c
↓ open down ↓ 164 lines elided ↑ open up ↑
 165  165                  break;
 166  166          case STMT_GOTO:
 167  167                  /* people put extra breaks inside switch statements */
 168  168                  if (stmt->goto_label && stmt->goto_label->type == SYM_NODE &&
 169  169                      strcmp(stmt->goto_label->ident->name, "break") == 0)
 170  170                          return;
 171  171                  break;
 172  172          default:
 173  173                  break;
 174  174          }
 175      -        sm_msg("info: ignoring unreachable code.");
      175 +        sm_warning("ignoring unreachable code.");
 176  176          print_unreached = 0;
 177  177  }
 178  178  
 179  179  static int is_turn_off(char *name)
 180  180  {
 181  181          char *tmp;
 182  182  
 183  183          if (!name)
 184  184                  return 0;
 185  185  
↓ open down ↓ 106 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX