Release R2022b of Polyspace® products lets you run a more precise Polyspace analysis, detect more types of issues, and review results more easily. You can now:
- Check for compliance with all statically enforceable AUTOSAR C++14 rules
- Find useless include files
- Import review information across projects more easily in Polyspace Access
- Apply external constraints to a Polyspace Bug Finder analysis for fewer false positives
- Configure Visual Studio Code to autocomplete Polyspace-style annotations with custom justifications
Learn more about these and other R2022b features below.
Check for All Statically Enforceable AUTOSAR C++14 Rules
Using Polyspace Bug Finder™, you can check for compliance with 100% of the statically enforceable AUTOSAR C++14 rules.
See also Polyspace Support for Coding Standards.
Find Useless Includes and Issues in Includes
During development, it is common practice to insert
#include-s as needed in C/C++ sources or copy a list of
#include-s from existing files. It is less common to clean up this list if resources from an include file (such as type declarations or macro declarations) are no longer needed. Over time, the includes in the
#include list at the beginning of a file can accumulate and increase the build time unnecessarily.
In R2022b, you can use a Polyspace Bug Finder checker to detect such useless includes. For each
#include in a file, the checker runs up the
#include hierarchy and determines if you have used any resource from the include (or from includes nested within those includes, at all levels of nesting). If not, the checker flags the
#include as a possible candidate for removal.
See also Useless Include.
Import Review Information Between Polyspace Access Projects
You can import review information, such as status, severity, and comments, from any project in Polyspace Access™ to any other project. After an import, all results that overlap between the two projects have the same review information.
For instance, suppose that some library files are reused in multiple projects, and you have justified some findings in these library files in one project. You can now port over those justifications to all other projects that use those files. You do not have to review and justify the findings again in the other project.
Apply External Constraints to Polyspace Bug Finder Analysis
You can specify external constraints on unknown inputs to reduce false positives in Bug Finder. Unknown inputs include user inputs to programs or return values of stubbed functions.
Later, if you perform a more exhaustive Polyspace Code Prover™ analysis, you can simply reuse any constraint you set up for the Bug Finder analysis.
Autocomplete Polyspace Annotations in Visual Studio Code
You can use code annotations to justify defects or coding rule violations. If the annotation follows or is mapped to a Polyspace-style syntax, Polyspace hides the justified results in future runs or shows them as reviewed.
In R2022b, autocompletion is available when you use Polyspace as You Code in Visual Studio Code. When you start typing
Polyspace to annotate a result, autocomplete suggestions appear for annotation syntaxes.
If your team or organization uses a predefined set of comments to justify analysis results, you can pass those comments to the Polyspace as You Code extension as a JSON catalog. The comments are then available to autocomplete your code annotations when you start typing in the Visual Studio Code editor.
R2022b offers other improvements such as:
- Polyspace as You Code walkthroughs in Visual Studio Code to get you started faster
- More information in results such as expected/actual values in constant overflows or inputs leading to non-initialized variables
- Support for Intel C++ Compiler Classic
- A new Polyspace as You Code view in Visual Studio Code to review findings in header files that are included in the analyzed file
For more information, see these release notes: