Menu ▾ ▴

#428 -xC100 is ignored in the constructor initializer list context

wont-fix
None
2017-03-19
2017-03-09
AmH
No

Perhaps a separate bug from #421 but definitely related. Given the arguments -xC100 and -M70, I expect this:

ClassName tables[] =
{
   ClassName(classarg1name, sizeof(some_long_struct_name), 1, ClassName::DESTINATION, 60000, "0.0.0.0"),
   ClassName(classarg1name, sizeof(some_long_struct_name), 1, ClassName::DESTINATION, 60000, "0.0.0.0"),
};

To be reformatted to this:

ClassName tables[] =
{
   ClassName(classarg1name, sizeof(some_long_struct_name), 1, ClassName::DESTINATION, 60000,
             "0.0.0.0"),
   ClassName(classarg1name, sizeof(some_long_struct_name), 1, ClassName::DESTINATION, 60000,
             "0.0.0.0"),
};

This might still be an options related problem though my understanding is that the combination of -xC100 and -M70 should guarantee the correct behavior. Indeed, this is exactly what happens if the above lines are moved just inside a function's opening brace. It appears -xC100 is ignored in the above initializer list context.

Discussion

  • Jim Pattee

    Jim Pattee - 2017-03-19
    • status: open --> wont-fix
    • assigned_to: Jim Pattee
     
  • Jim Pattee

    Jim Pattee - 2017-03-19

    This is an array.
    Some code will not be broken, such as comments, quotes, and arrays.

     

Log in to post a comment.