See following example.

$ cat indent.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 indent.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 --version
GNU indent 2.2.10
$

I don't want indent to 1) put the single ',' char in its own line for the
arr[] initialization; 2) break `{ 0 }' into two lines. Any workarounds?

Thanks.

-clark
_______________________________________________
bug-indent mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-indent

Reply via email to