R2026a

New Features, Bug Fixes, Compatibility Considerations

Analysis Setup

 Polyspace Query Language: Create your own coding rules and coding standards

In R2026a, you can use Polyspace Query Language (PQL) to create your own defect checkers and coding standards. PQL is a declarative query language designed for analyzing C/C++ code. By using PQL, you can:

Polyspace now supports the new command polyspace-query-language and the file format .pql for these workflows.

For details about PQL syntax and workflows, see Create Your Own Coding Rules and Coding Standard.

  Polyspace Platform: Default user interface for static analysis

Starting in R2026a, the Polyspace Platform user interface is the default user interface for static analysis. Polyspace Platform supports static analysis and dynamic testing of C/C++ code in one common interface. This means that:

  • You can perform a single one-time setup for static analysis and dynamic testing.

  • You can view results of static analysis and dynamic testing on a common dashboard.

  • Polyspace Bug Finder and Polyspace Code Prover™ provide information that makes the dynamic testing workflow easier.

 Compatibility Considerations

You can migrate your current Polyspace project files (.psprj) to Polyspace Platform project files (.psprjx). For more information on migration steps or reverting to the classic Polyspace user interface, see Using Polyspace Platform as Default User Interface for Static Analysis.

 Polyspace Platform: Create modular projects and reuse shared configurations by referencing external configuration files

When you create a build, static analysis, or testing and profiling configuration in the Polyspace Platform user interface, it is saved in the .psprjx project file. Starting in R2026a, you can modularize your Polyspace Platform project to improve sharing and version control workflows by converting build, static analysis, and testing and profiling configurations to external configurations. An external configuration is a configuration that you save in a separate .pscfg file that is linked to one or more projects by reference.

For more information, see Create Easily Shareable Projects for Version Control.

 Polyspace Platform: Preferences renamed to Settings

Polyspace Platform Preferences has been renamed to Polyspace Platform Settings. For more information, see Polyspace Platform Settings.

Polyspace Platform: Keep results from only the latest run

Starting in R2026a, when you use the Polyspace Platform user interface, you can specify whether to keep results from all runs, or to keep results from only the latest run. By default, Polyspace keeps results from all runs. If you change this setting to keep results from only the latest run:

  • Polyspace stores results from static analysis and dynamic testing runs in the same run subfolder, according to their result type (Defects, RTE, or Tests).

  • Polyspace overwrites previous results of the same type, preserving any justifications from earlier runs.

For more information, see Polyspace Platform Settings.

Polyspace Platform: Set documentation location to web or locally installed doc

Starting in R2026a, when you use the Polyspace Platform user interface, you can specify whether to open documentation on the web, at www.mathworks.com (internet connection required), or to open documentation that is installed locally.

For more information, see Polyspace Platform Settings.

Polyspace Platform: Change user interface colors by selecting dark or light theme

Starting in R2026a, you can specify a light or dark color scheme for the Polyspace Platform user interface. By default, the Polyspace Platform theme matches the current operating system color scheme.

For more information and current limitations, see Polyspace Platform Settings.

Polyspace Platform: Specify output folder when generating launching script for a project

Starting in R2026a, you can use the optional -output-dir argument to specify an output folder when using the polyspace-project -generate-launching-script-for command. Use this command to generate the files needed to run static analysis on a Polyspace Platform project from the command line.

Compiler Support: Analyze code written for Clang versions 17.x, 18.x, and 19.x

In R2026a, Polyspace supports analyzing C/C++ code written for Clang compiler versions 17.x, 18.x, and 19.x. If you build your source code by using any of these Clang compiler versions, specify the compiler name as clang17.x, clang18.x, or clang19.x.

Previously, to analyze code written for these compilers, you had to manually define compiler-specific macros and language extensions. Now, you can specify these compilers during configuration and Polyspace defines the necessary macros and language extensions.

In the Polyspace Platform user interface, specify the Clang version using the option Compilation toolchain (Static Analysis).

At the command line, specify a compiler by using the option -compiler. For instance:

polyspace-bug-finder-server -sources file.c -compiler clang17.x ...
For more information, see Compilation toolchain (Static Analysis).

Simulink Support: Project Settings now open in Polyspace Platform user interface

Starting in R2026a, configure the Polyspace analysis options for generated code in the Polyspace Platform user interface. In the Polyspace section of the Simulink® toolstrip, select Settings > Project Settings.

The Project Setting Button now open the Polyspace platform UI

The Polyspace Platform user interface opens.

The Polyspace platform UI

Polyspace prepopulates the options necessary to analyze generated code. Update the options in the Build and Static Analysis tabs of the Configuration pane to configure your analysis.

The configuration parameter Use custom project file now supports .psprjx projects by default. The .psprj project templates remain supported.

Simulink Support: New Simulink context menu design for Polyspace Code Verifier

The way in which you use the Simulink context menu for the Polyspace Code Verifier app has changed.

To view the Polyspace Code Verifier options in the context menu, right-click the canvas, hover over Select Apps, and select Polyspace Code Verifier. A Polyspace Code Verifier section appears in the context menu. Use the options in this section to run Polyspace analyses, access Polyspace configuration parameters, and open results.

The simulink context menu with the Polyspace Code Verifier app section highlighted.

The context menu has a dropdown to choose between Polyspace Bug Finder and Polyspace Code Prover:

  • Prove Code for Model — Verifies absence of runtime errors by running a Code Prover verification on the code generated from the model.

  • Find Bugs in Model Code — Finds bugs by running a Bug Finder analysis on the code generated from the model.

The context menu contains these commonly used buttons:

Context menu buttonAction
Run default Polyspace analysis.
Open the Polyspace pane in the Configuration Parameters dialog box.
Open the analysis result.

To view annotation options in the context menu, right-click a block. The annotation options appear in the Polyspace Code Verifier section.

The simulink context menu with the annotation functionalities of the Polyspace Code Verifier app section highlighted.

Context menu buttonAction
The icon to add annotation.Add Polyspace annotations to the block.
The icon to copy annotation.Copy the existing Polyspace annotations from the block.
The icon to paste annotation.Paste Polyspace annotations to the block.
The icon to delete annotation.Delete existing Polyspace annotations from the block.

For more information about the changes to the Simulink context menu, see Find Simulink Context Menu Options (Simulink).

Concurrency: Autodetect thread creation and critical sections implemented using Zephyr thread APIs

Starting in R2026a, Polyspace supports the thread APIs from the Zephyr real-time operating system kernel. Polyspace recognizes these concurrency functions:

  • k_thread_create

  • k_sem_take

  • k_sem_give

If your code uses these functions for implementing multitasking, Polyspace autodetects thread creation and critical sections. For more details, see Auto-Detection of Thread Creation and Critical Section in Polyspace.

Because the analysis of code containing recursive mutexes is now more precise, the number of coding rule violations and defects reported on your code related to concurrency can change.

Concurrency: Detect concurrency issues in code containing POSIX recursive mutex

Starting in R2026a, Polyspace supports recursive mutexes from the POSIX library. Recursive mutexes allow multiple locking and the same number of unlocking by the same thread or task without causing a deadlock. Polyspace now no longer reports concurrency issues for such use of POSIX recursive mutexes. Consider this code:


#include <pthread.h>

pthread_mutex_t Rb;

void* t1(void *ignore) {
    (void)ignore;
    pthread_mutex_lock(&Rb);
    pthread_mutex_lock(&Rb);  // No DOUBLE_LOCK
    pthread_mutex_unlock(&Rb);
    pthread_mutex_unlock(&Rb);
    return 0;
}

int main(void) {
    pthread_t id1;
    pthread_mutexattr_t Attr;

    pthread_mutexattr_init(&Attr);
    pthread_mutexattr_settype(&Attr, PTHREAD_MUTEX_RECURSIVE);
    pthread_mutex_init(&Rb, &Attr);

    pthread_create(&id1, 0, t1, 0);
    pthread_join(id1, 0);

    return 0;
}
In this code, the thread t1 locks the recursive mutex Rb twice and then unlocks it twice.

Polyspace Bug Finder recognizes the recursive nature of the mutex and does not report the defect Double lock.

For more details, see Auto-Detection of Thread Creation and Critical Section in Polyspace.

Because the analysis of code containing recursive mutexes is now more precise, the number of coding rule violations and defects reported on your code related to concurrency can change.

 Support for Mac computers with Apple silicon processors

Starting in R2026a, you can run Polyspace products on Mac computers that use Apple silicon processors with ARM® architecture. Polyspace products are no longer supported on Intel®-based Mac computers.

Migrate your projects to the Polyspace Platform user interface to continue using Polyspace on Mac. For more information, see Using Polyspace Platform as Default User Interface for Static Analysis.

The following features are not currently supported when using Apple silicon-based Macs:

  • Report generation. You can continue to perform report generation on Windows® or Linux® machines. Alternatively, you can use the polyspace-results-export command to export your results to a CSV or JSON file.

  • Editing data range specification (DRS) in the user interface. You can configure DRS on Apple silicon-based Macs by pasting the constraint XML file path into the Constraint setup text box. You can edit the constraint XML file in the Polyspace Platform user interface on Windows or Linux machines. Alternatively, manually edit this file outside of the user interface, see XML File Format for Polyspace Analysis Constraints.

  • Offloading analysis to another computer.

  • Creating a Polyspace Platform project by tracing a build command. Instead, you can generate a JSON compilation database using your build system and create a Polyspace project from this compilation database. For more information, see polyspace-configure.

 Changes in analysis options and binaries

Default output format of polyspace-configure command will change and option -output-project will be removed in a future release

Warns

The default output format of the polyspace-configure command will change in a future release. In addition, the option -output-project will also be removed.

Currently, the polyspace-configure command – by default or when used with the -output-project option – generates a project file in the .psprj format. This format is intended for the classic Polyspace user interface, which has been replaced with the Polyspace Platform user interface. For more information, see Using Polyspace Platform as Default User Interface for Static Analysis (Polyspace Code Prover).

To generate Polyspace Platform projects in the new .psprjx format using polyspace-configure, use the -output-platform-project option. This new format will become the default format in a future release.

Analysis Results

 Simulink Support: Targets modeled with greater precision

Starting in R2026a, the code generation targets you specify in Simulink are modeled by Polyspace with greater precision.

 Compatibility Considerations

This change can result in a different number of results in your analysis.

CERT C Support: Check for violations of 28 additional recommendations

In R2026a, you can check for violations of 28 new CERT® C recommendations in addition to previously supported rules and recommendations.

CERT C RecommendationsDescription Polyspace Checker
API01-CAvoid laying out strings in memory directly before sensitive dataCERT C: Rec. API01-C
API02-CFunctions that read or write to or from an array should take an argument to specify the source or target sizeCERT C: Rec. API02-C
API05-CUnspecified Array Size in Function SignatureCERT C: Rec. API05-C
DCL03-CUse a static assertion to test the value of a constant expressionCERT C: Rec. DCL03-C
DCL04-CDo not declare more than one variable per declarationCERT C: Rec. DCL04-C
DCL05-CUse typedefs of non-pointer types onlyCERT C: Rec. DCL05-C
DCL09-CDeclare functions that return errno with a return type of errno_tCERT C: Rec. DCL09-C
DCL20-CExplicitly specify void when a function accepts no argumentsCERT C: Rec. DCL20-C
ERR01-CUse ferror() rather than errno to check for FILE stream errorsCERT C: Rec. ERR01-C
ERR06-CUnderstand the termination behavior of assert() and abort()CERT C: Rec. ERR06-C
ERR07-CPrefer functions that support error checking over equivalent functions that don'tCERT C: Rec. ERR07-C
EXP02-CBe aware of the short-circuit behavior of the logical AND and OR operatorsCERT C: Rec. EXP02-C
EXP16-CDo not compare function pointers to constant valuesCERT C: Rec. EXP16-C
EXP20-CPerform explicit tests to determine success, true and false, and equalityCERT C: Rec. EXP20-C
INT16-CDo not make assumptions about representation of signed integersCERT C: Rec. INT16-C
INT17-CDefine integer constants in an implementation-independent mannerCERT C: Rec. INT17-C
MSC00-CCompile cleanly at high warning levelsCERT C: Rec. MSC00-C
MSC05-CDo not manipulate time_t typed values directlyCERT C: Rec. MSC05-C
MSC06-CBeware of compiler optimizationsCERT C: Rec. MSC06-C
POS04-CAvoid using PTHREAD_MUTEX_NORMAL type mutex locksCERT C: Rec. POS04-C
PRE02-CMacro replacement lists should be parenthesizedCERT C: Rec. PRE02-C
SIG02-CAvoid using signals to implement normal functionalityCERT C: Rec. SIG02-C
STR00-CRepresent characters using an appropriate typeCERT C: Rec. STR00-C
STR10-CDo not concatenate different type of string literalsCERT C: Rec. STR10-C
WIN01-CDo not forcibly terminate executionCERT C: Rec. WIN01-C
WIN02-CRestrict privileges when spawning child processesCERT C: Rec. WIN02-C
WIN03-CUnderstand HANDLE inheritanceCERT C: Rec. WIN03-C
WIN04-CConsider encrypting function pointersCERT C: Rec. WIN04-C

For the complete list of supported CERT C rules and recommendations, see CERT C Rules and Recommendations.

CWE Support: Check for violations of 29 additional rules in CWE 4.17

In R2026a, Polyspace supports Common Weakness Enumeration (CWE™) version 4.17. In this release, you can check for violations of 29 new CWE rules in addition to previously supported rules.

CWE RuleDescription Polyspace Checkers
CWE 176Improper Handling of Unicode EncodingCWE Rule 176
CWE 187Partial String ComparisonCWE Rule 187
CWE 193Off-by-one ErrorCWE Rule 193
CWE 233Improper Handling of ParametersCWE Rule 233
CWE 234Failure to Handle Missing ParameterCWE Rule 234
CWE 295Improper Certificate ValidationCWE Rule 295
CWE 324Use of a Key Past its Expiration DateCWE Rule 324
CWE 363Race Condition Enabling Link FollowingCWE Rule 363
CWE 403Exposure of File Descriptor to Unintended Control Sphere ('File Descriptor Leak')CWE Rule 403
CWE 432Dangerous Signal Handler not Disabled During Sensitive OperationsCWE Rule 432
CWE 459Incomplete CleanupCWE Rule 459
CWE 462Duplicate Key in Associative List (Alist)CWE Rule 462
CWE 464Addition of Data Structure SentinelCWE Rule 464
CWE 494Download of Code Without Integrity CheckCWE Rule 494
CWE 521Weak Password RequirementsCWE Rule 521
CWE 588Attempt to Access Child of a Non-structure PointerCWE Rule 588
CWE 597Use of Wrong Operator in String ComparisonCWE Rule 597
CWE 689Permission Race Condition During Resource CopyCWE Rule 689
CWE 768Incorrect Circuit EvaluationCWE Rule 768
CWE 771Missing Reference to Active Allocated ResourceCWE Rule 771
CWE 773Missing Reference to Active File Descriptor or HandleCWE Rule 773
CWE 775Missing Release of File Descriptor or Handle after Effective LifetimeCWE Rule 775
CWE 781Improper Address Validation in IOCTL with METHOD_NEITHER I/O Control CodeCWE Rule 781
CWE 782Exposed IOCTL with Insufficient Access ControlCWE Rule 782
CWE 788Access of Memory Location After End of BufferCWE Rule 788
CWE 835Loop with Unreachable Exit ConditionCWE Rule 835
CWE 909Missing Initialization of ResourceCWE Rule 909
CWE 911Improper Update of Reference CountCWE Rule 911
CWE-1325Improperly Controlled Sequential Memory AllocationCWE Rule 1325

For all CWE rules supported with Polyspace Bug Finder, see Common Weakness Enumeration (CWE).

In accordance with CWE version 4.17, these CWE rules are recategorized:

CWE RuleChange in Categorization

These rules are now part of both CWE658 and CWE659
CWE Rule 190This rule is no longer part of CWE659
CWE Rule 88This rule is moved to the category Data Neutralization Issues.
CWE Rule 1335This rule is moved to the category Numeric Issues.
CWE Rule 1341This rule is moved to the category Resource Management Errors.

These rules are moved to the category Others.

Bug Finder Defects: Check for inappropriate utility functions, misuse of unique_ptr, and wasteful enumerations

In R2026a, you can use Bug Finder to check for these new defects:

For the full list of checkers, see Defects. For more information on defect groups, see Bug Finder Defect Groups.

Accuracy Improvement: Out of bounds array access reported on member function calls

Starting in R2026a, Polyspace reports defects and coding rule violations if a member function of an array element is invoked using an out of bounds element. For example, consider this code:

class Foo {
  // ...
public:
  int func();
  int x;
};

int main() {
  constexpr int N = 4;
  Foo a[N];
  volatile int rd;
  int i = N;
  
  
  if (rd) {
    return a[i].func(); // Defect - Array access out of bounds
  }
}
The call to the member function func() is invoked using an array element that is out of bound. Polyspace reports an Array access out of bounds defect.

Reviewing Results

Simulink Support: Review results in Polyspace Platform user interface

Starting in R2026a, after you perform a Polyspace analysis using the Polyspace Code Verifier app, the Results Overview dashboard opens in the Polyspace Platform user interface.

Results Overview dashboard in the Polyspace Platform user interface.

To review the results list, click Review.

In R2026a, you can:

  • Navigate to the model directly from the Result Details pane by clicking the Go To Model button (). The Simulink block that causes the Polyspace result is highlighted in the Simulink editor.

  • Copy annotations from individual results in the Results Details pane to corresponding Simulink blocks by using the Annotate Block button (). The annotations you entered are copied as Polyspace Annotation to the Simulink block. If multiple Polyspace results correspond to the same block, annotation for each result is copied to the block separately.

Result Detail with new Go To Model and Annotate Block buttons

For more details, see Address Polyspace Results by Annotating Simulink Blocks.

Source Code: Result highlighting for multi-line violations

Starting in R2026a, when you select a Polyspace result from the Results List, Polyspace now highlights the entire relevant code range for the result rather than a single line. This can be useful when reviewing complex rules where multiple lines of code contribute to the issue.

 Functionality being removed or changed

polyspace-report-generator options will be removed

Still runs

The following options for the polyspace-report-generator command will be removed in a future release:

  • -generate-results-list-file

  • -generate-variable-access-file

  • -key-mode

Use polyspace-results-export instead for exporting results to an external format such as CSV or JSON.

Use the VariableAccess report template for generating a global variables accesses report. See Bug Finder and Code Prover report (-report-template).