Menu

#8 Erroneous formatting

open
nobody
None
5
2007-03-08
2007-03-08
Anonymous
No

if you have code like this:

void MyFunc(void)
// one or more comment lines
{
SomeCode();
}

after formatting with kr option you get this:

void MyFunc(void)
// one or more comment lines {
SomeCode();
}

which is obviously wrong!

That is a show stopper for me :(

Regards,
--
Francisco

Discussion

  • Nobody/Anonymous

    Logged In: NO

    I forgot to mention that this is not the case with Artistic Style 1.20.2
    I'm using Astyleclipse 1.0.101.v200610192129

     
  • Nobody/Anonymous

    Logged In: NO

    Note that you must have trailing spaces in the comment line.

     
  • Nobody/Anonymous

    Logged In: NO

    another interesting test case:
    ------- cut here -----------

    void MyFunc(struct t P)
    // comment
    {
    AnyThing();
    }

    void MyFunc2(int P)
    // comment
    {
    AnyThing();
    }
    ------- cut here -----------

    becomes
    ------- cut here -----------

    void MyFunc(struct t P)
    // comment {
    AnyThing();
    }

    void MyFunc2(int P)
    // comment
    {
    AnyThing();
    }
    ------- cut here -----------

    Myfunc is wrongly reformatted, Myfunc2 is not touched.
    There are no trailling spaces in the comment line.

     

Log in to post a comment.