|
1 | 1 | ---
|
2 | 2 | title: "/analyze (Code analysis)"
|
3 | 3 | description: "The Microsoft C++ compiler /analyze option syntax and usage."
|
4 |
| -ms.date: 05/12/2021 |
| 4 | +ms.date: 05/21/2021 |
5 | 5 | f1_keywords: ["VC.Project.VCCLCompilerTool.EnablePREfast", "/analyze", "VC.Project.VCCLCompilerTool.PREfastAdditionalOptions", "VC.Project.VCCLCompilerTool.PREfastAdditionalPlugins"]
|
6 | 6 | helpviewer_keywords: ["/analyze compiler option [C++]", "-analyze compiler option [C++]", "analyze compiler option [C++]"]
|
7 | 7 | ms.assetid: 81da536a-e030-4bd4-be18-383927597d08
|
@@ -53,13 +53,13 @@ Log file content options:
|
53 | 53 | ::: moniker range="msvc-150"
|
54 | 54 |
|
55 | 55 | Ruleset options:
|
56 |
| -> **`/analyze:ruleset`** *ruleset_files* |
| 56 | +> **`/analyze:ruleset`** *ruleset_file* |
57 | 57 |
|
58 | 58 | ::: moniker-end
|
59 | 59 |
|
60 | 60 | ::: moniker range=">=msvc-160"
|
61 | 61 |
|
62 |
| -Ruleset location options: |
| 62 | +Ruleset options: |
63 | 63 | > **`/analyze:projectdirectory`** *`project_directory`*\
|
64 | 64 | > **`/analyze:rulesetdirectory`** *`ruleset_directories`*\
|
65 | 65 | > **`/analyze:ruleset`** *`ruleset_files`*
|
@@ -191,28 +191,33 @@ Adds both suppressed warnings and unsuppressed warnings to the analysis log file
|
191 | 191 |
|
192 | 192 | ::: moniker-end
|
193 | 193 |
|
194 |
| -::: moniker range="msvc-150" |
| 194 | +::: moniker range=">=msvc-150" |
195 | 195 |
|
196 | 196 | #### Ruleset options
|
197 | 197 |
|
198 | 198 | ::: moniker-end
|
199 | 199 |
|
200 | 200 | ::: moniker range=">=msvc-160"
|
201 | 201 |
|
202 |
| -#### Ruleset location options |
203 |
| - |
204 | 202 | **`/analyze:projectdirectory`** *`project_directory`*\
|
205 | 203 | Specifies the current project directory. If the ruleset (or an item it includes) is a file name, the compiler first looks for the file under the specified *`project_directory`*. If not found, it next searches the *`ruleset_directories`* specified by **`/analyze:rulesetdirectory`**, if any. If the ruleset (or an item it includes) is a relative path, the compiler first looks for the file under the project directory. If the ruleset isn't found, then it looks in the current working directory. This option is available starting in Visual Studio 2019 version 16.9.
|
206 | 204 |
|
207 | 205 | **`/analyze:rulesetdirectory`** *`ruleset_directories`*\
|
208 | 206 | Specifies a semicolon-separated list of ruleset search paths. If the ruleset (or an item it includes) is a file name, then the compiler first looks for the file under the *`project_directory`* specified by **`/analyze:projectdirectory`**, if any, followed by the specified *`ruleset_directories`*. This option is available starting in Visual Studio 2019 version 16.9.
|
209 | 207 |
|
| 208 | +**`/analyze:ruleset`** *`ruleset_files`*\ |
| 209 | +Specifies one or more ruleset files to use for analysis. This option can make analysis more efficient. That's because the analysis engine tries to exclude checkers that have no active rules specified in the ruleset files before running. Otherwise, the engine runs all checkers enabled. |
| 210 | + |
210 | 211 | ::: moniker-end
|
211 | 212 |
|
212 |
| -::: moniker range=">=msvc-150" |
| 213 | +::: moniker range="msvc-150" |
213 | 214 |
|
214 |
| -**`/analyze:ruleset`** *`ruleset_files`*\ |
215 |
| -Specifies one or more ruleset files to use for analysis. This option can make analysis more efficient. That's because the analysis engine tries to exclude checkers that have no active rules specified in the ruleset files before running. Otherwise, the engine runs all checkers enabled. |
| 215 | +**`/analyze:ruleset`** *`ruleset_file`*\ |
| 216 | +Specifies a ruleset file to use for analysis. This option can make analysis more efficient. That's because the analysis engine tries to exclude checkers that have no active rules specified in the ruleset file before running. Otherwise, the engine runs all checkers enabled. |
| 217 | + |
| 218 | +::: moniker-end |
| 219 | + |
| 220 | +::: moniker range=">=msvc-150" |
216 | 221 |
|
217 | 222 | The ruleset files that ship with Visual Studio are found in *`%VSINSTALLDIR%\Team Tools\Static Analysis Tools\Rule Sets`*.
|
218 | 223 |
|
|
0 commit comments