Text   |  XML   |  ReML   |   Visible Warnings:

Unreachable Control Flow  at ascend-scanner.c:1512

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

ascendlex

(/home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/ascend-scanner.c)expand/collapse
Show more  
 1176  YY_DECL 
 1177  {
 1178          register yy_state_type yy_current_state;
 1179          register char *yy_cp, *yy_bp;
 1180          register int yy_act;
 1181       
 1182  #line 118 "ascend-scanner.l"
 1183   
 1184   
 1185  #line 1186 "ascend-scanner.c"
 1186   
 1187          if ( !(yy_init) )
 1188                  {
 1189                  (yy_init) = 1;
 1190   
 1191  #ifdef YY_USER_INIT 
 1192                  YY_USER_INIT;
 1193  #endif
 1194   
 1195                  if ( ! (yy_start) )
 1196                          (yy_start) = 1; /* first start state */
 1197   
 1198                  if ( ! ascendin )
 1199                          ascendin = stdin;
 1200   
 1201                  if ( ! ascendout )
 1202                          ascendout = stdout;
 1203   
 1204                  if ( ! YY_CURRENT_BUFFER ) {
 1205                          ascendensure_buffer_stack ();
 1206                          YY_CURRENT_BUFFER_LVALUE =
 1207                                  ascend_create_buffer(ascendin,YY_BUF_SIZE );
 1208                  }
 1209   
 1210                  ascend_load_buffer_state( );
 1211                  }
 1212   
 1213          while ( 1 )             /* loops until end-of-file is reached */
 1214                  {
 1215                  yy_cp = (yy_c_buf_p);
 1216   
 1217                  /* Support of ascendtext. */
 1218                  *yy_cp = (yy_hold_char);
 1219   
 1220                  /* yy_bp points to the position in yy_ch_buf of the start of 
 1221                   * the current run.
 1222                   */
 1223                  yy_bp = yy_cp;
 1224   
 1225                  yy_current_state = (yy_start);
 1226  yy_match:
 1227                  do 
 1228                          {
 1229                          register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
 1230                          if ( yy_accept[yy_current_state] )
 1231                                  {
 1232                                  (yy_last_accepting_state) = yy_current_state;
 1233                                  (yy_last_accepting_cpos) = yy_cp;
 1234                                  }
 1235                          while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 1236                                  {
 1237                                  yy_current_state = (int) yy_def[yy_current_state];
 1238                                  if ( yy_current_state >= 342 )
 1239                                          yy_c = yy_meta[(unsigned int) yy_c];
 1240                                  }
 1241                          yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
 1242                          ++yy_cp;
 1243                          }
 1244                  while ( yy_current_state != 341 );
 1245                  yy_cp = (yy_last_accepting_cpos);
 1246                  yy_current_state = (yy_last_accepting_state);
 1247   
 1248  yy_find_action:
 1249                  yy_act = yy_accept[yy_current_state];
 1250   
 1251                  YY_DO_BEFORE_ACTION;
 1252   
 1253  do_action:      /* This label is used only to access EOF actions. */
 1254   
 1255                  switch ( yy_act )
 1256          { /* beginning of action switch */
 1257                          case 0: /* must back up */
 1258                          /* undo the effects of YY_DO_BEFORE_ACTION */
 1259                          *yy_cp = (yy_hold_char);
 1260                          yy_cp = (yy_last_accepting_cpos);
 1261                          yy_current_state = (yy_last_accepting_state);
 1262                          goto yy_find_action;
 1263   
 1264  case 1:
 1265  YY_RULE_SETUP 
 1266  #line 120 "ascend-scanner.l"
 1267  {
 1268    BEGIN(sc_ether_direction);
 1269    ascendlval.d = ASCEND_PFX_ETHER;
 1270    return ETHER_PREFIX;
 1271  }
 1272          YY_BREAK 
 1273  case 2:
 1274  YY_RULE_SETUP 
 1275  #line 126 "ascend-scanner.l"
 1276  {
 1277    BEGIN(sc_isdn_call);
 1278    ascendlval.d = ASCEND_PFX_ISDN_X;
 1279    return ISDN_PREFIX;
 1280  }
 1281          YY_BREAK 
 1282  case 3:
 1283  YY_RULE_SETUP 
 1284  #line 132 "ascend-scanner.l"
 1285  {
 1286    BEGIN(sc_isdn_call);
 1287    ascendlval.d = ASCEND_PFX_ISDN_R;
 1288    return ISDN_PREFIX;
 1289  }
 1290          YY_BREAK 
 1291  case 4:
 1292  YY_RULE_SETUP 
 1293  #line 138 "ascend-scanner.l"
 1294  {
 1295    BEGIN(sc_wds_user);
 1296    ascendlval.d = ASCEND_PFX_WDS_X;
 1297    return WDS_PREFIX;
 1298  }
 1299          YY_BREAK 
 1300  case 5:
 1301  YY_RULE_SETUP 
 1302  #line 144 "ascend-scanner.l"
 1303  {
 1304    BEGIN(sc_wds_user);
 1305    ascendlval.d = ASCEND_PFX_WDS_R;
 1306    return WDS_PREFIX;
 1307  }
 1308          YY_BREAK 
 1309  case 6:
 1310  YY_RULE_SETUP 
 1311  #line 150 "ascend-scanner.l"
 1312  {
 1313    BEGIN(sc_wds_user);
 1314    ascendlval.d = ASCEND_PFX_WDS_X;
 1315    return WDS_PREFIX;
 1316  }
 1317          YY_BREAK 
 1318  case 7:
 1319  YY_RULE_SETUP 
 1320  #line 156 "ascend-scanner.l"
 1321  {
 1322    BEGIN(sc_wds_user);
 1323    ascendlval.d = ASCEND_PFX_WDS_R;
 1324    return WDS_PREFIX;
 1325  }
 1326          YY_BREAK 
 1327  case 8:
 1328  /* rule 8 can match eol */
 1329  YY_RULE_SETUP 
 1330  #line 162 "ascend-scanner.l"
 1331  {
 1332    BEGIN(sc_gen_task);
 1333    return STRING;  
 1334  }
 1335          YY_BREAK 
 1336  case 9:
 1337  /* rule 9 can match eol */
 1338  YY_RULE_SETUP 
 1339  #line 167 "ascend-scanner.l"
 1340  {
 1341    BEGIN(sc_gen_task);
 1342    return DECNUM;
 1343  }
 1344          YY_BREAK 
 1345  case 10:
 1346  /* rule 10 can match eol */
 1347  YY_RULE_SETUP 
 1348  #line 172 "ascend-scanner.l"
 1349  {
 1350    char *atcopy = g_strdup(ascendtext);
 1351    char colon = input();
 1352    char after = input();
 1353    int retval = STRING;
 1354   
 1355    unput(after); unput(colon);
 1356   
 1357    if (after != '(' && after != ' ') {
 1358      BEGIN(sc_wds_sess);
 1359      if (pseudo_header != NULL) {
 1360        g_strlcpy(pseudo_header->user, atcopy, ASCEND_MAX_STR_LEN);
 1361      }
 1362    } else {      /* We have a version 7 file */
 1363      BEGIN(sc_gen_task);
 1364      if (pseudo_header != NULL) {
 1365        g_strlcpy(pseudo_header->user, NO_USER, ASCEND_MAX_STR_LEN);
 1366      }
 1367      ascendlval.d = strtol(ascendtext, NULL, 10);
 1368      retval = DECNUM;
 1369    }
 1370    g_free (atcopy);
 1371    return retval;
 1372  }
 1373          YY_BREAK 
 1374  case 11:
 1375  YY_RULE_SETUP 
 1376  #line 197 "ascend-scanner.l"
 1377  {
 1378    BEGIN(sc_gen_task);
 1379    ascendlval.d = strtol(ascendtext, NULL, 10);
 1380    return DECNUM;
 1381  }
 1382          YY_BREAK 
 1383  case 12:
 1384  YY_RULE_SETUP 
 1385  #line 203 "ascend-scanner.l"
 1386  {
 1387    BEGIN(sc_gen_time_s);
 1388    ascendlval.d = strtoul(ascendtext, NULL, 16);
 1389    return HEXNUM;
 1390  }
 1391          YY_BREAK 
 1392  case 13:
 1393  YY_RULE_SETUP 
 1394  #line 209 "ascend-scanner.l"
 1395  {
 1396    return STRING;
 1397  }
 1398          YY_BREAK 
 1399  case 14:
 1400  YY_RULE_SETUP 
 1401  #line 213 "ascend-scanner.l"
 1402  {
 1403    BEGIN(sc_gen_time_u);
 1404    ascendlval.d = strtol(ascendtext, NULL, 10);
 1405    return DECNUM;
 1406  }
 1407          YY_BREAK 
 1408  case 15:
 1409  YY_RULE_SETUP 
 1410  #line 219 "ascend-scanner.l"
 1411  {
 1412    char *atcopy = g_strdup(ascendtext);
 1413    BEGIN(sc_gen_octets);
 1414    /* only want the most significant 2 digits. convert to usecs */
 1415    if (strlen(atcopy) > 2)
 1416      atcopy[2] = '\0';
 1417    ascendlval.d = strtol(atcopy, NULL, 10) * 10000;
 1418    g_free(atcopy);
 1419    return DECNUM;
 1420  }
 1421          YY_BREAK 
 1422  case 16:
 1423  YY_RULE_SETUP 
 1424  #line 230 "ascend-scanner.l"
 1425  {
 1426    BEGIN(sc_gen_counter);
 1427    ascendlval.d = strtol(ascendtext, NULL, 10);
 1428    return DECNUM;
 1429  }
 1430          YY_BREAK 
 1431  case 17:
 1432  YY_RULE_SETUP 
 1433  #line 236 "ascend-scanner.l"
 1434  {
 1435    BEGIN(sc_gen_byte);
 1436    return COUNTER;
 1437  }
 1438          YY_BREAK 
 1439  case 18:
 1440  YY_RULE_SETUP 
 1441  #line 241 "ascend-scanner.l"
 1442  {
 1443    ascendlval.b = (guint8)strtol(ascendtext, NULL, 16);
 1444    return HEXBYTE;
 1445  }
 1446          YY_BREAK 
 1447  case 19:
 1448  YY_RULE_SETUP 
 1449  #line 246 "ascend-scanner.l"
 1450  {  
 1451    BEGIN(sc_chardisp);
 1452  }
 1453          YY_BREAK 
 1454  case 20:
 1455  YY_RULE_SETUP 
 1456  #line 250 "ascend-scanner.l"
 1457  {  
 1458    BEGIN(sc_gen_byte);
 1459  }
 1460          YY_BREAK 
 1461  case 21:
 1462  YY_RULE_SETUP 
 1463  #line 254 "ascend-scanner.l"
 1464  {
 1465    BEGIN(sc_wdd_date_d);
 1466    return WDD_DATE;
 1467  }
 1468          YY_BREAK 
 1469  case 22:
 1470  YY_RULE_SETUP 
 1471  #line 259 "ascend-scanner.l"
 1472  {
 1473    BEGIN(sc_wdd_date_m);
 1474    ascendlval.d = strtol(ascendtext, NULL, 10);
 1475    return DECNUM;
 1476  }
 1477          YY_BREAK 
 1478  case 23:
 1479  YY_RULE_SETUP 
 1480  #line 265 "ascend-scanner.l"
 1481  {
 1482    BEGIN(sc_wdd_date_y);
 1483    ascendlval.d = strtol(ascendtext, NULL, 10);
 1484    return DECNUM;
 1485  }
 1486          YY_BREAK 
 1487  case 24:
 1488  YY_RULE_SETUP 
 1489  #line 271 "ascend-scanner.l"
 1490  {
 1491    BEGIN(sc_wdd_time);
 1492    ascendlval.d = strtol(ascendtext, NULL, 10);
 1493    return DECNUM;
 1494  }
 1495          YY_BREAK 
 1496  case 25:
 1497  YY_RULE_SETUP 
 1498  #line 277 "ascend-scanner.l"
 1499  {
 1500    BEGIN(sc_wdd_time_h);
 1501    return KEYWORD;
 1502  }
 1503          YY_BREAK 
 1504  case 26:
 1505  YY_RULE_SETUP 
 1506  #line 282 "ascend-scanner.l"
 1507  {
 1508    BEGIN(sc_wdd_time_m);
 1509    ascendlval.d = strtol(ascendtext, NULL, 10);
 1510    return DECNUM;
 1511  }
 1512          YY_BREAK 
 1513  case 27:
 1514  YY_RULE_SETUP 
 1515  #line 288 "ascend-scanner.l"
 1516  {
 1517    BEGIN(sc_wdd_time_s);
 1518    ascendlval.d = strtol(ascendtext, NULL, 10);
 1519    return DECNUM;
 1520  }
 1521          YY_BREAK 
 1522  case 28:
 1523  YY_RULE_SETUP 
 1524  #line 294 "ascend-scanner.l"
 1525  {
 1526    BEGIN(sc_wdd_cause);
 1527    ascendlval.d = strtol(ascendtext, NULL, 10);
 1528    return DECNUM;
 1529  }
 1530          YY_BREAK 
 1531  case 29:
 1532  YY_RULE_SETUP 
 1533  #line 300 "ascend-scanner.l"
 1534  {
 1535    BEGIN(sc_wdd_callnum);
 1536    return KEYWORD;
 1537  }
 1538          YY_BREAK 
 1539  case 30:
 1540  YY_RULE_SETUP 
 1541  #line 305 "ascend-scanner.l"
 1542  {
 1543    BEGIN(sc_wdd_chunk);
 1544    if (pseudo_header != NULL) {
 1545      g_strlcpy(pseudo_header->call_num, ascendtext, ASCEND_MAX_STR_LEN);
 1546    }
 1547    return STRING;
 1548  }
 1549          YY_BREAK 
 1550  case 31:
 1551  YY_RULE_SETUP 
 1552  #line 313 "ascend-scanner.l"
 1553  {
 1554    BEGIN(sc_wdd_chunknum);
 1555    return WDD_CHUNK;
 1556  }
 1557          YY_BREAK 
 1558  case 32:
 1559  YY_RULE_SETUP 
 1560  #line 318 "ascend-scanner.l"
 1561  {
 1562    BEGIN(sc_wdd_type);
 1563    ascendlval.d = strtoul(ascendtext, NULL, 16);
 1564    return HEXNUM;
 1565  }
 1566          YY_BREAK 
 1567  case 33:
 1568  YY_RULE_SETUP 
 1569  #line 324 "ascend-scanner.l"
 1570  {
 1571    BEGIN(sc_gen_task);
 1572    return KEYWORD;
 1573  }
 1574          YY_BREAK 
 1575  case 34:
 1576  YY_RULE_SETUP 
 1577  #line 329 "ascend-scanner.l"
 1578  {
 1579    return SLASH_SUFFIX;
 1580  }
 1581          YY_BREAK 
 1582  case 35:
 1583  YY_RULE_SETUP 
 1584  #line 333 "ascend-scanner.l"
 1585  { return HEXNUM; }
 1586          YY_BREAK 
 1587  case 36:
 1588  YY_RULE_SETUP 
 1589  #line 335 "ascend-scanner.l"
 1590  { return KEYWORD; }
 1591          YY_BREAK 
 1592  case YY_STATE_EOF(INITIAL):
 1593  case YY_STATE_EOF(sc_gen_task):
 1594  case YY_STATE_EOF(sc_gen_time_s):
 1595  case YY_STATE_EOF(sc_gen_time_u):
 1596  case YY_STATE_EOF(sc_gen_octets):
 1597  case YY_STATE_EOF(sc_gen_counter):
 1598  case YY_STATE_EOF(sc_gen_byte):
 1599  case YY_STATE_EOF(sc_wds_user):
 1600  case YY_STATE_EOF(sc_wds_sess):
 1601  case YY_STATE_EOF(sc_wdd_date_d):
 1602  case YY_STATE_EOF(sc_wdd_date_m):
 1603  case YY_STATE_EOF(sc_wdd_date_y):
 1604  case YY_STATE_EOF(sc_wdd_time):
 1605  case YY_STATE_EOF(sc_wdd_time_h):
 1606  case YY_STATE_EOF(sc_wdd_time_m):
 1607  case YY_STATE_EOF(sc_wdd_time_s):
 1608  case YY_STATE_EOF(sc_wdd_cause):
 1609  case YY_STATE_EOF(sc_wdd_callnum):
 1610  case YY_STATE_EOF(sc_wdd_chunk):
 1611  case YY_STATE_EOF(sc_wdd_chunknum):
 1612  case YY_STATE_EOF(sc_wdd_type):
 1613  case YY_STATE_EOF(sc_chardisp):
 1614  case YY_STATE_EOF(sc_isdn_call):
 1615  case YY_STATE_EOF(sc_ether_direction):
 1616  #line 337 "ascend-scanner.l"
 1617  { at_eof++; yyterminate(); }
 1618          YY_BREAK 
 1619  case 37:
 1620  /* rule 37 can match eol */
 1621  YY_RULE_SETUP 
 1622  #line 339 "ascend-scanner.l"
 1623  ;
 1624          YY_BREAK 
 1625  case 38:
 1626  YY_RULE_SETUP 
 1627  #line 341 "ascend-scanner.l"
 1628  ECHO;
 1629          YY_BREAK 
 1630  #line 1631 "ascend-scanner.c"
 1631   
 1632          case YY_END_OF_BUFFER:
 1633                  {
 1634                  /* Amount of text matched not including the EOB char. */
 1635                  int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
 1636   
 1637                  /* Undo the effects of YY_DO_BEFORE_ACTION. */
 1638                  *yy_cp = (yy_hold_char);
 1639                  YY_RESTORE_YY_MORE_OFFSET 
 1640   
 1641                  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
 1642                          {
 1643                          /* We're scanning a new file or input source.  It's
 1644                           * possible that this happened because the user 
 1645                           * just pointed ascendin at a new source and called 
 1646                           * ascendlex().  If so, then we have to assure 
 1647                           * consistency between YY_CURRENT_BUFFER and our 
 1648                           * globals.  Here is the right place to do so, because 
 1649                           * this is the first action (other than possibly a 
 1650                           * back-up) that will match for the new input source.
 1651                           */
 1652                          (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
 1653                          YY_CURRENT_BUFFER_LVALUE->yy_input_file = ascendin;
 1654                          YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
 1655                          }
 1656   
 1657                  /* Note that here we test for yy_c_buf_p "<=" to the position 
 1658                   * of the first EOB in the buffer, since yy_c_buf_p will 
 1659                   * already have been incremented past the NUL character
 1660                   * (since all states make transitions on EOB to the
 1661                   * end-of-buffer state).  Contrast this with the test
 1662                   * in input().
 1663                   */
 1664                  if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
 1665                          { /* This was really a NUL. */
 1666                          yy_state_type yy_next_state;
 1667   
 1668                          (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
 1669   
 1670                          yy_current_state = yy_get_previous_state(  );
 1671   
 1672                          /* Okay, we're now positioned to make the NUL
 1673                           * transition.  We couldn't have 
 1674                           * yy_get_previous_state() go ahead and do it 
 1675                           * for us because it doesn't know how to deal
 1676                           * with the possibility of jamming (and we don't
 1677                           * want to build jamming into it because then it 
 1678                           * will run more slowly).
 1679                           */
 1680   
 1681                          yy_next_state = yy_try_NUL_trans( yy_current_state );
 1682   
 1683                          yy_bp = (yytext_ptr) + YY_MORE_ADJ;
 1684   
 1685                          if ( yy_next_state )
 1686                                  {
 1687                                  /* Consume the NUL. */
 1688                                  yy_cp = ++(yy_c_buf_p);
 1689                                  yy_current_state = yy_next_state;
 1690                                  goto yy_match;
 1691                                  }
 1692   
 1693                          else 
 1694                                  {
 1695                                  yy_cp = (yy_last_accepting_cpos);
 1696                                  yy_current_state = (yy_last_accepting_state);
 1697                                  goto yy_find_action;
 1698                                  }
 1699                          }
 1700   
 1701                  else switch ( yy_get_next_buffer(  ) )
 1702                          {
 1703                          case EOB_ACT_END_OF_FILE:
 1704                                  {
 1705                                  (yy_did_buffer_switch_on_eof) = 0;
 1706   
 1707                                  if ( ascendwrap( ) )
 1708                                          {
 1709                                          /* Note: because we've taken care in 
 1710                                           * yy_get_next_buffer() to have set up
 1711                                           * ascendtext, we can now set up 
 1712                                           * yy_c_buf_p so that if some total
 1713                                           * hoser (like flex itself) wants to
 1714                                           * call the scanner after we return the 
 1715                                           * YY_NULL, it'll still work - another 
 1716                                           * YY_NULL will get returned.
 1717                                           */
 1718                                          (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
 1719   
 1720                                          yy_act = YY_STATE_EOF(YY_START);
 1721                                          goto do_action;
 1722                                          }
 1723   
 1724                                  else 
 1725                                          {
 1726                                          if ( ! (yy_did_buffer_switch_on_eof) )
 1727                                                  YY_NEW_FILE;
 1728                                          }
 1729                                  break;
 1730                                  }
 1731   
 1732                          case EOB_ACT_CONTINUE_SCAN:
 1733                                  (yy_c_buf_p) =
 1734                                          (yytext_ptr) + yy_amount_of_matched_text;
 1735   
 1736                                  yy_current_state = yy_get_previous_state(  );
 1737   
 1738                                  yy_cp = (yy_c_buf_p);
 1739                                  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
 1740                                  goto yy_match;
 1741   
 1742                          case EOB_ACT_LAST_MATCH:
 1743                                  (yy_c_buf_p) =
 1744                                  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
 1745   
 1746                                  yy_current_state = yy_get_previous_state(  );
 1747   
 1748                                  yy_cp = (yy_c_buf_p);
 1749                                  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
 1750                                  goto yy_find_action;
 1751                          }
 1752                  break;
 1753                  }
 1754   
 1755          default:
 1756                  YY_FATAL_ERROR(
 1757                          "fatal flex scanner internal error--no action found" );
 1758          } /* end of action switch */
 1759                  } /* end of scanning one token */
 1760  } /* end of ascendlex */
Show more  




Change Warning 961.30503 : Unreachable Control Flow

Because they are very similar, this warning shares annotations with 34 other warnings.   show all

Priority:
State:
Finding:
Owner:
Note: