i conform that i declare a constructor in the class, but it still report this error that does not declare a constructor.
pls see the detail below:
class AMS_DMS : public IDMS2<--- The class 'AMS_DMS' does not declare a constructor although it has private member variables which likely require initialization. [+]
{
public:
IMPLEMENT_AXISBASE_NAME("AMS_URANUS80")
AMS_DMS();
virtual ~AMS_DMS();
}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It is often hard to reproduce by writing code from scratch because there might be some non-obvious detail in your code that confuses Cppcheck.
Can you please try to reduce your original code instead. Start with all the code that generates the warning. Then remove piece-by-piece from the file and every time check if cppcheck still writes such complaint.
I would start removing large chunks. Remove a large chunk of code that you think is not necessary to reproduce the false positive. If the false positive goes away then undo in the editor and try removing something else..
Last edit: Daniel Marjamäki 2022-07-06
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
i conform that i declare a constructor in the class, but it still report this error that does not declare a constructor.
pls see the detail below:
class AMS_DMS : public IDMS2<--- The class 'AMS_DMS' does not declare a constructor although it has private member variables which likely require initialization. [+]
{
public:
IMPLEMENT_AXISBASE_NAME("AMS_URANUS80")
AMS_DMS();
virtual ~AMS_DMS();
}
anyone else who can tell me what should i do in this case?
cppcheck version is v2.8
Posting sufficient code to actually reproduce the problem would be helpful.
I don't get a warning for
i try to change the code as below,it do not report this error.
class AMS_DMS : public IDMS2
{
public:
IMPLEMENT_AXISBASE_NAME("AMS_URANUS80")
};
It is often hard to reproduce by writing code from scratch because there might be some non-obvious detail in your code that confuses Cppcheck.
Can you please try to reduce your original code instead. Start with all the code that generates the warning. Then remove piece-by-piece from the file and every time check if cppcheck still writes such complaint.
I would start removing large chunks. Remove a large chunk of code that you think is not necessary to reproduce the false positive. If the false positive goes away then undo in the editor and try removing something else..
Last edit: Daniel Marjamäki 2022-07-06