C1444: Initialization of <Variable> is skipped by 'case' label

[ERROR]

Description

Initialization of a local variable is skipped by a 'case' label.

Example
    void main(void){

  
      int i;

  
      

  
      switch(i){

  
        int myVar = 5;

  
        case 0:          // C1444 init skipped

  
          //...

  
          break;

  
        case 1:          // C1444 init skipped

  
          //...

  
          break;  

  
      }

  
Tips

Declare the local variable in the block where it is used.

    void main(void){

  
      int i;

  
      

  
      switch(i){

  
        case 0:

  
          //...

  
          break;

  
        case 1:

  
          int myVar = 5;

  
          //...

  
          break;  

  
      }