User and Reference Guide for the Intel® C++ Compiler 14.0
Enables static analysis diagnostics. You can determine which diagnostics to emit based on severity or you can specify an analysis mode for diagnostic messages.
Linux OS: | -diag-enable sc[n] -diag-enable sc-mode -diag-disable sc |
OS X: | None |
Windows OS: | /Qdiag-enable:sc[n] /Qdiag-enable:sc-mode /Qdiag-disable:sc |
n |
Specifies the level of severity to report. Possible values are:
This value is equivalent to deprecated option sv[n]. |
||||||
mode |
Specifies the analysis mode. Possible values are:
|
-diag-disable sc and /Qdiag-disable:sc |
Static analysis diagnostics are disabled. |
This option enables static analysis diagnostics.
If you specify n for the option, you can determine which diagnostics to emit based on severity. If you specify mode, you can also specify an analysis mode for diagnostic messages.
To disable static analysis, specify /Qdiag-disable:sc (Windows* OS) or option -diag-disable sc (Linux* OS).
You can also specify the following options that affect the diagnostics:
Option [Q]diag-error setting sc
This changes all Static Analysis diagnostics to errors.
Option [Q]diag-warning setting sc
This changes all Static Analysis diagnostics to warnings.
Option [Q]diag-remark setting sc
This changes all Static Analysis diagnostics to remarks (comments).
This static analysis feature requires installation of another product. For more information, see Feature Requirements.
Windows: Diagnostics > Level of Static Analysis (/Qdiag-enable:sc{1|2|3} )
Diagnostics > Mode of Static Analysis (/Qdiag-enable:sc-{full|concise|precise})
Linux: Compilation Diagnostics > Level of Static Analysis (-diag-enable sc{1|2|3} or -diag-disable sv)
Compilation Diagnostics > Mode of Static Analysis (-diag-enable sc-{full|concise|precise})
OS X: None
None
The following example shows how to produce static analysis diagnostic messages for all critical errors:
-diag-enable sc1 ! Linux systems
/Qdiag-enable:sc1 ! Windows systems
The following example shows how to cause static analysis diagnostics (and default diagnostics) to be sent to a file:
-diag-enable sc -diag-file=stat_ver_msg ! Linux systems
/Qdiag-enable:sc /Qdiag-file:stat_ver_msg ! Windows systems
Note that you need to enable static analysis diagnostics before you can send them to a file. In this case, the diagnostics are sent to file stat_ver_msg.diag. If a file name is not specified, the diagnostics are sent to name-of-the-first-source-file.diag.