#272 volatile enum bracing incorrect when using --style=kr

closed-fixed
Jim Pattee
None
7
2015-02-14
2014-02-28
Andrew Garber
No

Input:

volatile enum {
    A,
    B
} foo;

Expected output when running astyle --style=kr:

volatile enum {
    A,
    B
} foo;

Actual output:

volatile enum
{   
    A,  
    B   
}   
foo;

Discussion

  • Andrew Garber
    Andrew Garber
    2014-02-28

    This bug is present in both 2.03 and 2.04.

     
  • Andrew Garber
    Andrew Garber
    2014-03-04

    The same bug is present when using const instead of volatile.

    On line 501 of ASResource.cpp, I see the following comment:

    NOTE: Do NOT add 'enum' here. It is an array type bracket.

    If I add a push_back for AS_ENUM in ASResource::buildPreDefinitionHeaders, the bug goes away. I'm not sure if that causes any regressions though.

     
  • Jim Pattee
    Jim Pattee
    2014-10-16

    • status: open --> open-fixed
    • assigned_to: Jim Pattee
    • Priority: 5 --> 7
     
  • Jim Pattee
    Jim Pattee
    2014-10-16

    Fixed.

     
  • Jim Pattee
    Jim Pattee
    2014-11-20

    • Status: open-fixed --> closed-fixed