bug-indent
[Top][All Lists]
Advanced

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

Two indent problems


From: Clark Wang
Subject: Two indent problems
Date: Wed, 8 Apr 2015 14:06:36 +0800

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


reply via email to

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