Intel® C++ Compiler XE 13.1 User and Reference Guides
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: | -diag-enable sc[n] -diag-enable sc-mode -diag-disable sc |
OS X: | None |
Windows: | /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:
-diag-error sc (Linux OS) or /Qdiag-error:sc (Windows OS)
This changes all Static Analysis diagnostics to errors.
-diag-warning sc (Linux OS) or /Qdiag-warning:sc (Windows OS)
This changes all Static Analysis diagnostics to warnings.
-diag-remark sc (Linux OS) or /Qdiag-remark:sc (Windows OS)
This changes all Static Analysis diagnostics to remarks (comments).
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.