C/C++ Specific Analysis

Static verification analyzes C/C++ source code and checks for various kinds of errors, warnings, and/or debatable points in your program. It also points out places of improper code style and flaws in object-oriented design solutions.

Static verification detects issues with the following:

The following example illustrates C/C++ specific analysis.

1 #include "stdio.h"

2 class A {

3 public:

4 A() { destroy(); }

5

6 void destroy() { clear0();}

7

8 virtual void clear()=0;

9

10 void clear0() { clear(); };

11 };

12

13 class B : public A {

14 public:

15 B(){ }

16

17 virtual void clear(){ printf("overloaded clear"); }

18

19 virtual ~B() { }

20 };

21

22 int main() {

23 B b;

24 return 0;

25 }

Static verification issues the following message:

test2.cpp(10): warning #12327: [SV] pure virtual function 'clear' is called from constructor (file:test2.cpp line:4)