Main Content

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

Specify files on which you do not want analysis results

Description

This option affects a Bug Finder analysis only.

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). The source or header files you specify as input to this option are not removed from the Polyspace® analysis. This option only suppresses the results. For instance, if you suppress results from a file that has compilation errors, the analysis still shows the compilation errors.

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.

Set Option

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

User interface (Polyspace Platform, desktop products only): In your project configuration, the option is on the Static Analysis tab on the Defects and Coding Standards 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. You can also show results or suppress results display from groups of files using the option -classification. This option allows you to define file sets and attach behaviors to these file sets. If you specify the following behavior for all files in a file set, you have the same effect as using the option -do-not-generate-results-for on the files:

    <show-results value="false"/>
    The option -classification supports specifying wildcard characters such as ? and * to specify file and folder patterns. For more information, see:

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

    A defect or coding rule can involve more than one file if it is checking for issues that arise or are detected when linking several translation units. For example:

  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 (Bug Finder Server): polyspace-bug-finder-server -lang c -sources file_name -misra2 required-rules -do-not-generate-results-for custom="C:\usr\include"

Version History

Introduced in R2016a