Re: astyle

From: Tsantilas Christos <chtsanti@dont-contact.us>
Date: Mon, 07 Jan 2008 23:55:04 +0200

Alex Rousskov wrote:
> On Sat, 2008-01-05 at 13:05 +0200, Tsantilas Christos wrote:
...
>
> I suggest removing break-blocks both because of the above bug and
> because it is trying to detect "unrelated blocks, classes, etc." which
> smells too much like AI to me.
>
> The --brackets=linux (-l) option is useful though. Can you check whether
> there is another --brackets option that works without the above bug and
> does the subset of what --brackets=linux does?

We can only use the --brackets=break option which works well.
This option format the code as:

void Foo(bool isFoo)
{
    if (isFoo)
    {
        bar();
    }
    else
    {
        anotherBar();
    }
}

(This format is awful but considering the hours I spent to merge the
HEAD in async-calls ... it is the best :-) ! )

>
>> 2) Bit fields in structs are not formated well.

> This cannot be disabled, right? If all bit-fields are "unsigned int",
> perhaps we can run a simple pre-processor that will convert
>
> unsigned int foo : 1;
>
> into
>
> unsigned int foo__FORASTYLE__1;
>
> and then post-process the sources to undo the conversion?

This is not bad idea. Maybe we can fix other problems too using this method.
With a (very) quick view looks that all bit fields are unsigned ints.

>
> Finally, please consider reporting the above bugs to astyle if nobody
> has done that already.

The bugs are reported. And many other too :-) . I frightened a little
looking in astyle bugzila:
http://sourceforge.net/tracker/?group_id=2319&atid=102319
Received on Mon Jan 07 2008 - 14:55:10 MST

This archive was generated by hypermail pre-2.1.9 : Wed Jan 30 2008 - 12:00:09 MST