Menu ▾ ▴

#126 --pad-oper doesn't behave correctly with multiply

closed-fixed
2023-09-23
2011-12-08
No

If the lhs argument to the `*' operator is a function call, no padding is inserted around the operator.

c:\SourcePro\main>type t.cpp
int g(float x, float t, float mx)
{
if (f(x)*t < mx) {
return 1;
}

return 0;
}
c:\SourcePro\main>astyle --pad-oper < t.cpp
int g(float x, float t, float mx)
{
if (f(x)*t < mx) {
return 1;
}

return 0;
}

As a workaround, I can reverse the parameters. I can also work around the problem by inserting a set of parenthesis around `t'.

Discussion

  • André Simon

    André Simon - 2023-06-30
    • status: open --> open-accepted
    • assigned_to: André Simon
     
  • André Simon

    André Simon - 2023-09-01

    You can test a fix in the latest git commit.

     
  • André Simon

    André Simon - 2023-09-23
    • status: open-accepted --> closed-fixed
     
  • André Simon

    André Simon - 2023-09-23

    Fixed in 3.4.8.

     

Log in to post a comment.