bug-indent
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 11/11] Fix formatting of struct initializer lists, and add -s


From: Clark Wang
Subject: Re: [PATCH 11/11] Fix formatting of struct initializer lists, and add -sar
Date: Wed, 17 Jun 2015 13:08:19 +0800

On Tue, Jun 16, 2015 at 5:36 PM, Tim Hentenaar <address@hidden>
wrote:

> Hi Clark,
>
> On Tue, Jun 16, 2015 at 10:41:11AM +0800, clarkw wrote:
> > Can anyone also take a look at another problem reported at
> > http://lists.gnu.org/archive/html/bug-indent/2015-04/msg00002.html ?
> >
> > -clark
>
> Try building with this patch. It should solve that problem:
>
> http://lists.gnu.org/archive/html/bug-indent/2015-06/msg00007.html
>

Hi Tim,

Does your github repository ( https://github.com/thentenaar/indent )
include all these patches? I just tried your latest code (commit
3c3dbe3e33) but it did not work. See followng example:

$ cat foo.c
void foo()
{
    struct_a arr[] = {
        { &a, sizeof (a) },
        { &b, sizeof (b) },
        { &c, sizeof (c) },
        { &d, sizeof (d) }
    };

    struct {
        int a;
        int b;
    } v = { 0 };
}
$ ./indent -st foo.c
void
foo ()
{
  struct_a arr[] = {
    {&a, sizeof (a)}
    ,
    {&b, sizeof (b)}
    ,
    {&c, sizeof (c)}
    ,
    {&d, sizeof (d)}
  };

  struct
  {
    int a;
    int b;
  } v = { 0 };
}
$

-clark

>
> You can see that from the regression tests here (with the -sar option,
> spaces are added around the '{' and '} in the initializer:
>
> http://lists.gnu.org/archive/html/bug-indent/2015-06/msg00017.html
>
>
> Tim
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]