Main Content

Generate results for sources and (-generate-results-for)

(Removed) Specify files on which you want analysis results

This option applies only to coding rules and code metrics, which has been removed from Code Prover. Use Generate results for sources and (-generate-results-for) in Bug Finder instead. For more information, see Version History.

Description

Specify files on which you want analysis results.

By default, results appear on source files and header files in the same folder as the source files. You can use this option to see results in other header files. If you use the option Do not generate results for (-do-not-generate-results-for) to suppress entire folders, you can use this option to unsuppress some subfolders or files in those folders.

The option applies only to coding rule violations and code metrics. You cannot suppress Code Prover run-time checks from select source and header files.

Set Option

User interface (desktop products only): In your project configuration, the option is on the Inputs & Stubbing node.

Command line and options file: Use the option -generate-results-for. See Command-Line Information.

Why Use This Option

Use this option to see results in header files that are most relevant to you.

For instance, by default, results are generated on header files that are located in the same folder as the source files. Often, other header files belong to a third-party library. Though these header files are required for a precise analysis, you are not interested in reviewing findings in those headers. Therefore, by default, results are not generated for those headers. If you are interested in certain headers from third-party libraries, change the default value of this option.

Note that in Polyspace as You Code, you cannot see results in headers #include-d through a source file at all. The default behavior is to consider the headers in the same folder as the source file (or subfolders) for analysis but suppress results found in the headers. You can use this option only to expand the scope of which headers are considered during analysis. See also Analysis Scope of Polyspace as You Code (Polyspace Access).

Settings

Default: source-headers

source-headers

Results appear on source files and header files in the same folder as the source files or in subfolders of source file folders.

The source files are the files that you add to the Source folder of your Polyspace® project (or use with the argument -sources at the command line).

all-headers

Results appear on source files and all header files. The header files can be in the same folder as source files, in subfolders of source file folders or in include folders.

The source files are the files that you add to the Source folder of your Polyspace project (or use with the argument -sources at the command line).

The include folders are the folders that you add to the Include folder of your Polyspace project (or use with the argument -I at the command line).

custom

Results appear on source files and the files that you specify. If you enter a folder name, results appear on header files in that folder (and its subfolders).

Click to add a field. Enter a file or folder name.

Tips

  1. Use this option in combination with appropriate values for the option Do not generate results for (-do-not-generate-results-for).

    If you choose custom and the values for the two options conflict, the more specific value determines the display of results. For instance, in the following examples, the value for the option Generate results for sources and is more specific.

    Generate results for sources andDo not generate results forFinal Result

    custom:

    C:\Includes\Custom_Library\

    custom:

    C:\Includes

    Results are displayed on header files in C:\Includes\Custom_Library\ and its subfolders but not generated for other header files in C:\Includes.

    custom:

    C:\Includes\my_header.h

    custom:

    C:\Includes\

    Results are displayed on the header file my_header.h in C:\Includes\ but not generated for other header files in C:\Includes\ and its subfolders.

    Using these two options together, you can suppress results from all files in a certain folder but unsuppress select files in those folders.

  2. If you choose all-headers for this option, results are displayed on all header files irrespective of what you specify for the option Do not generate results for.

Command-Line Information

Parameter: -generate-results-for
Value: source-headers | all-headers | custom=file1[,file2[,...]] | custom=folder1[,folder2[,...]]
Example (Bug Finder): polyspace-bug-finder -lang c -sources file_name -misra2 required-rules -generate-results-for custom="C:\usr\include"
Example (Code Prover): polyspace-code-prover -lang c -sources file_name -misra2 required-rules -generate-results-for custom="C:\usr\include"
Example (Bug Finder Server): polyspace-bug-finder-server -lang c -sources file_name -misra2 required-rules -generate-results-for custom="C:\usr\include"
Example (Code Prover Server): polyspace-code-prover-server -lang c -sources file_name -misra2 required-rules -generate-results-for custom="C:\usr\include"

Version History

Introduced in R2016a

expand all

R2024a: Removed from Code Prover

If you use the option -generate-results-for in a Code Prover analysis, Polyspace issues a warning and the analysis ignores the option. The workflow for checking coding rule violation has been removed from Code Prover. To check for coding rule violations, use Bug Finder. For instance, at the command line, replace this command:

polyspace-code-prover -lang c -sources file_name -misra2 required-rules -do-not-generate-results-for custom="C:\usr\include"
with this command:
polyspace-bug-finder -lang c -sources file_name -misra2 required-rules -do-not-generate-results-for custom="C:\usr\include"
See Migrate Code Prover Workflows for Checking Coding Standards and Code Metrics to Bug Finder.