Examples of errors detected by the V622 diagnostic.


V622. Consider inspecting the 'switch' statement. It's possible that the first 'case' operator is missing.


K Desktop Environment

V622 Consider inspecting the 'switch' statement. It's possible that the first 'case' operator is missing. listjob.cpp 131


void ListJob::doStart()
{
  Q_D( ListJob );

  switch ( d->option ) {
    break;                          // <=
  case IncludeUnsubscribed:
    d->command = "LIST";
    break;
  case IncludeFolderRoleFlags:
    d->command = "XLIST";
    break;
  case NoOption:
  default:
    d->command = "LSUB";
  }
  ....
}

Miranda NG

V622 Consider inspecting the 'switch' statement. It's possible that the first 'case' operator is missing. UInfoEx ctrl_contact.cpp 188


static INT_PTR CALLBACK DlgProc_EMail(....)
{
  case WM_COMMAND:
    switch (LOWORD(wParam)) {
      if (HIWORD(wParam) == BN_CLICKED) {
        case IDOK:
  ....
}

Similar errors can be found in some other places:

  • V622 Consider inspecting the 'switch' statement. It's possible that the first 'case' operator is missing. UInfoEx ctrl_contact.cpp 290

CryEngine V

V622 Consider inspecting the 'switch' statement. It's possible that the first 'case' operator is missing. mergedmeshrendernode.cpp 999


static inline void ExtractSphereSet(....)
{
  ....
  switch (statusPos.pGeom->GetType())
  {
    if (false)
    {
    case GEOM_CAPSULE:
      statusPos.pGeom->GetPrimitive(0, &cylinder);
    }
    if (false)
    {
    case GEOM_CYLINDER:
      statusPos.pGeom->GetPrimitive(0, &cylinder);
    }
    for (int i = 0; i < 2 && ....; ++i)
    {
      ....
    }
    break;
  ....
}

Tizen

V622 Consider inspecting the 'switch' statement. It's possible that the first 'case' operator is missing. streamrecorder_test.c 472


static void main_menu(gchar buf)
{
  ....
  switch (buf) {
    if (recorder_state == STREAMRECORDER_STATE_RECORDING) {
    case 'p': /* Pause Recording*/
      g_print("*Pause!\n");
      err = streamrecorder_pause(hmstreamrecorder->recorder);

      if (err < 0)
        LOGE("Rec pause streamrecorder_pause  = %x", err);

      recorder_state = STREAMRECORDER_STATE_PAUSED;
      break;
   } else {
     case 'r': /* Resume Recording*/
       g_print("*Resume!\n");
       err = streamrecorder_start(hmstreamrecorder->recorder);
       if (err < 0)
         LOGE("Rec start streamrecorder_record  = %x", err);

       recorder_state = STREAMRECORDER_STATE_RECORDING;
       break;
   }
  ....
}


Do you make errors in the code?

Check your code
with PVS-Studio

Static code analysis
for C, C++, and C#

goto PVS-Studio;
We use cookies for the analysis of events to improve our content and make user interaction more convenient. By continuing the view of our web-pages you accept the terms of using these files. You can find out more about cookie-files and privacy policy or close the notification, by clicking on the button. Learn More →
Do not show again