Re: astyle

From: Amos Jeffries <squid3@dont-contact.us>
Date: Tue, 08 Jan 2008 16:45:25 +1300

Alex Rousskov wrote:
> On Mon, 2008-01-07 at 23:55 +0200, Tsantilas Christos wrote:
>> 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 :-) ! )
>
> What do others think regarding making the above a temporary format
> default until astyle improves or a better replacement is available?
> [Not] spending hours on merging branches can be a strong-enough
> motivation to use less-than-perfect format above...
>
> Or would it be better to post-process atyle-formatted code to untangle

Less processing the better.
So putting up with a small ugly in exchange for a complicated hack is
okay by me.

On the bit-field problem, I have a similar mind. Even though the wrap is
extremely ugly the suggested fix makes code almost unreadable.

If we have to go the way of hacking bitfields around astyle, I would
suggest going to a macro (yuck). Like so:

#define BITFIELD(name,bits) unsigned int name : bits

   struct {
         BITFIELD(name, 1);
         BITFIELD(flag, 1);
   }

>
> #if FOO {
> }
>
> lines?
>
> Cheers,
>
> Alex.
>
>

Amos

-- 
Please use Squid 2.6STABLE17 or 3.0STABLE1.
There are serious security advisories out on all earlier releases.
Received on Mon Jan 07 2008 - 20:45:29 MST

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