We need to get our project compiling with no warnings from maximum level gcc. Currently we have a lot of warnings about the following:
struct Bob
{
int a;
int b;
Bob()
: b(0)
, a(0)
{
}
};
The warning says that the order of the initialization list does not match the order the members are declared in the class. I understand this warning because the real order of initialization comes from the order of members in the class, and if some depend on others, arranging the initialization list in the same order can help spot bugs.
However, we have TONS (and tons) of code which have initialization lists not matching the member order and the members don't depend on each other, so there's no problem. But we are Required to remove all warnings from our code.
Is there some automatic way we can solve this? Did I mention we have tons of code?
Thanks!!