|Skip Navigation Links|
|Exit Print View|
|Oracle Solaris Studio 12.3 Code Analyzer User's Guide Oracle Solaris Studio 12.3 Information Library|
The Code Analyzer analyzes three types of data:
Static code errors detected during compilation
Dynamic memory access errors and warnings detected by Discover, the memory error discovery tool
Code coverage data measured by Uncover, the code coverage tool
In addition to giving you access to each individual type of analysis, the Code Analyzer integrates static code checking and dynamic memory access checking to add confidence levels to errors found in code. By using static code checking together with dynamic memory access analysis and code coverage analysis, you will be able to find many important errors in your applications that cannot be found by other error detection tools working by themselves.
The Code Analyzer also pinpoints the core issues in your code, those issues that, when fixed, are likely to eliminate the other issues. A core issue usually combines several other issues because, for example, the issues have a common allocation point, or occur at the same data address in the same function.
Static code checking detects common programming errors in your code during compilation. The -xanalyze=code option for the C and C++ compilers leverages the compilers' extensive and well proven control and data flow analysis frameworks to analyze your application for potential programming and security flaws.
For information on collecting static error data, see Collecting Static Error Data.
For a list of the static code errors the Code Analyzer analyzes, see Static Code Issues.
Memory-related errors in your code are often difficult to find. When you instrument your program with Discover before running it, Discover catches and reports memory access errors dynamically during program execution. For example, if your program allocates an array and does not initialize it, and then tries to read from a location in the array, the program is likely to behave erratically. If you instrument the program with Discover and then run it, Discover will catch the error.
For information on collecting dynamic memory access error data, see Collecting Dynamic Memory Access Data.
For a list of the dynamic memory access issues the Code Analyzer analyzes, see Dynamic Memory Access Issues.
Code coverage is an important part of software testing. It gives you information on which areas of your code are exercised in testing and which are not, enabling you to improve your test suites to test more of your code. The Code Analyzer uses data collected by Uncover to determine which functions in your program are uncovered and the percentage of coverage that will be added to the total coverage for the application if a test covering the relevant function is added.
For information on collecting code coverage data, see Collecting Code Coverage Data.