Menu

#613 indent_label should align instruction in same line

Future
fixed
None
5
2016-03-24
2014-12-23
No

Using configuration /dev/null:

switch (i)
{
case 0:
        foo();
j: bar();
        break;
}

bar() should be aligned under foo(). (There should be 1 space only if the label is too long.)

Discussion

  • Anonymous

    Anonymous - 2016-02-03

    Please!

     
  • Guy Maurel

    Guy Maurel - 2016-03-17

    j: is a label.
    Let me know why you need a label whithin a switch statement.

     
  • Anonymous

    Anonymous - 2016-03-17

    It has nothing special to do with a switch statement, but think of something like

    switch (i)
    {
    case 0:
        foo();
    j: bar();
        break;
    
    case 1:
        something();
        goto j;
    }
    

    The same issue can be observed, for example, with

        if (skip) goto j;
        foo();
    j: bar();
    

    The statement behing the label lacks alignment.

     
  • Guy Maurel

    Guy Maurel - 2016-03-22

    Using:
    j:
    bar();

    will be correct.
    I take it in the wish list.

     
    • Anonymous

      Anonymous - 2016-03-22

      There is no such thing as a correct using.
      There are only user-specific codings and a tool named uncrustify that can reproduce these user-specific codings.

       
  • Guy Maurel

    Guy Maurel - 2016-03-22
    • status: open --> wont-fix
    • assigned_to: Guy Maurel
     
  • Guy Maurel

    Guy Maurel - 2016-03-24
    • status: wont-fix --> fixed