Main Content

Do not generate results for (-do-not-generate-results-for)

(Removed) Specify files on which you do not want analysis results

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

Description

Specify files on which you do not want analysis results.

By default, results do not appear on header files (unless they are in the same folder as the source files). You can use this option to suppress results from some source files too (or from header files in the same folders as source files). If you use the option Generate results for sources and (-generate-results-for) to show results on some include folders, you can use this option to suppress results from some subfolders or files in those include folders.

The option applies only to coding rule violations and code metric. You cannot suppress Code Prover run-time checks from 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 -do-not-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. If you are not interested in reviewing the findings in those headers, change the default value of this option.

Note that in Polyspace as You Code, the default behavior is to not even analyze the headers in non-source folders. You can use this option to expand the scope of not analyzed files to all headers or a different subset of headers. See also Analysis Scope of Polyspace as You Code (Polyspace Access).

Settings

Default: include-folders

include-folders

Results are not generated for header files in include folders (and their subfolders).

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).

If an include folder is a subfolder of a source folder, results are generated for files in that include folder even if you specify the option value include-folders. In this situation, use the option value custom and explicitly specify the include folders to ignore.

all-headers

Results are not generated for 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 are not generated for the files that you specify. If you enter a folder name, results are suppressed from files in that folder (and its subfolders).

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

Tips

  1. Use this option appropriately in combination with appropriate values for the option Generate results for sources and (-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 suppressed from all header files irrespective of what you specify for the option Generate results for sources and.

  3. If a defect or coding rule violation involves two files and you do not generate results for one of the files, the defect or rule violation still appears. For instance, if you define two variables with similar-looking names in files myFile.cpp and myFile.h, you get a violation of the MISRA™ C++ rule 2-10-1, even if you do not generate results for myFile.h. MISRA C++ rule 2-10-1 states that different identifiers must be typographically unambiguous.

    The following results can involve more than one file:

     MISRA C: 2004 Rules

     MISRA C: 2012 Directives and Rules

     MISRA C++ Rules

     JSF C++ Rules

     Polyspace Bug Finder Defects

  4. If a global variable is never used after declaration, it appears in Code Prover results as an unused global variable. However, if it is declared in a file for which you do not want results, you do not see the unused variable in your verification results.

  5. If a result (coding rule violation or Bug Finder defect) is inside a macro, Polyspace typically shows the result on the macro definition instead of the macro occurrences so that you review the result only once. Even if the macro is used in a suppressed file, the result is still shown on the macro definition, if the definition occurs in an unsuppressed file.

Command-Line Information

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

Version History

Introduced in R2016a

expand all

R2024a: Removed from Code Prover

If you use the option -do-not-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.