I'm currently updating my cppcheck installation to version 1.7.2, now there are some new warnings. I was trying to figure out what is "best practise" but did'nt find anything.
My original code looks like this:
Now, im getting an "uninitMemberVar"-warning, because "memberOfDerivedClass" is supposed to be not initialized (which is definitly wrong). If i'm changing the order of the initialization list from the derived class as follow, it works without warnings:
But i had the opinion that its much more readable to pass the parameters in the order the constructors are called. Is this behavior a bug or am i simply wrong?
Thanks for your help
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm currently updating my cppcheck installation to version 1.7.2, now there are some new warnings. I was trying to figure out what is "best practise" but did'nt find anything.
My original code looks like this:
Now, im getting an "uninitMemberVar"-warning, because "memberOfDerivedClass" is supposed to be not initialized (which is definitly wrong). If i'm changing the order of the initialization list from the derived class as follow, it works without warnings:
But i had the opinion that its much more readable to pass the parameters in the order the constructors are called. Is this behavior a bug or am i simply wrong?
Thanks for your help
I cannot reproduce with git head. Is that a stand-alone example? Otherwise it might have been fixed already.
This looks like a bug in cppcheck.