Skip to content

Repo sync for protected CLA branch #4604

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions docs/code-quality/using-the-cpp-core-guidelines-checkers.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Using the C++ Core Guidelines checkers
description: "How to set up and use the Microsoft C++ Code Analysis rules for C++ Core Guidelines."
ms.date: 12/16/2020
ms.date: 06/21/2023
ms.topic: "conceptual"
dev_langs:
- CPP
Expand Down Expand Up @@ -231,9 +231,9 @@ You can use the command-line option to temporarily disable all code analysis for

Sometimes it's useful to do focused code analysis and still use the Visual Studio IDE. Try the following sample scenario for large projects. It can save build time and make it easier to filter results:

1. In the command shell, set the `esp.extension` and `esp.annotationbuildlevel` environment variables.
1. In the command shell, set the `esp.extension` environment variable.

1. To inherit these variables, open Visual Studio from the command shell.
1. To inherit this variable, open Visual Studio from the command shell.

1. Load your project and open its properties.

Expand Down Expand Up @@ -269,10 +269,6 @@ You can run the C++ Core Checker only on specified files. Use the same approach

```xml
<ItemGroup>
<BuildMacro Include="Esp_AnnotationBuildLevel">
<EnvironmentVariable>true</EnvironmentVariable>
<Value>Ignore</Value>
</BuildMacro>
<BuildMacro Include="Esp_Extensions">
<EnvironmentVariable>true</EnvironmentVariable>
<Value>CppCoreCheck.dll</Value>
Expand All @@ -294,7 +290,7 @@ Code Analysis requires a few environment variables and compiler command-line opt

- **Environment variables**
- `set esp.extensions=cppcorecheck.dll` This tells the engine to load the C++ Core Guidelines module.
- `set esp.annotationbuildlevel=ignore` This disables the logic that processes SAL annotations. Annotations don't affect code analysis in the C++ Core Guidelines Checker, yet their processing takes time (sometimes a long time). This setting is optional, but highly recommended.
- Since Visual Studio 2019 we no longer recommend setting the `esp.annotationbuildlevel` environment variable because setting it can result in false positives. If seeing unexpected results, remove this variable from your environment.
- `set caexcludepath=%include%` We highly recommend that you disable warnings that fire on standard headers. You can add more paths here, for example the path to the common headers in your project.

- **Command-line options**
Expand Down