You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/build/configure-cmake-debugging-sessions.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: "Configure CMake debugging sessions in Visual Studio"
3
3
description: "Describes how to use Visual Studio to configure CMake debugger settings."
4
-
ms.date: "12/07/2020"
4
+
ms.date: 12/16/2020
5
5
helpviewer_keywords: ["CMake debugging"]
6
6
---
7
7
# Configure CMake debugging sessions
@@ -14,7 +14,7 @@ Native CMake support is available in Visual Studio 2017 and later. To see the do
14
14
15
15
::: moniker range=">=msvc-150"
16
16
17
-
All executable CMake targets are shown in the **Startup Item** dropdown in the **General**toolbar. Select one to start a debugging session and launch the debugger.
17
+
All executable CMake targets are shown in the **Startup Item** dropdown in the toolbar. Select one to start a debugging session and launch the debugger.
@@ -105,8 +105,10 @@ In Visual Studio 2019 version 16.6, we added a new debug configuration of `type:
105
105
#### Additional options allowed with the `gdbserver` configuration (16.7 or later)
106
106
107
107
-`program`: Defaults to `"${debugInfo.fullTargetPath}"`. The Unix path to the application to debug. Only required if different than the target executable in the build or deploy location.
108
-
> [!TIP]
109
-
> Deploy is not yet supported for local cross-compilation scenarios. If you are cross-compiling on Windows (for example, using a cross-compiler on Windows to build a Linux ARM executable) then you'll need to manually copy the binary to the location specified by `program` on the remote ARM machine before debugging.
108
+
109
+
> [!TIP]
110
+
> Deploy is not yet supported for local cross-compilation scenarios. If you are cross-compiling on Windows (for example, using a cross-compiler on Windows to build a Linux ARM executable) then you'll need to manually copy the binary to the location specified by `program` on the remote ARM machine before debugging.
111
+
110
112
-`remoteMachineName`: Defaults to `"${debugInfo.remoteMachineName}"`. Name of the remote system that hosts the program to debug. Only required if different than the build system. Must have an existing entry in the [Connection Manager](../linux/connect-to-your-remote-linux-computer.md). Press **Ctrl+Space** to view a list of all existing remote connections.
111
113
-`cwd`: Defaults to `"${debugInfo.defaultWorkingDirectory}"`. Full Unix path to the directory on the remote system where `program` is run. The directory must exist.
112
114
-`gdbPath`: Defaults to `${debugInfo.vsInstalledGdb}`. Full Windows path to the `gdb` used to debug. Defaults to the `gdb` installed with the Linux development with C/C++ workload.
Copy file name to clipboardExpand all lines: docs/code-quality/c26401.md
+27-5Lines changed: 27 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,23 +1,23 @@
1
1
---
2
2
title: C26401
3
-
ms.date: 07/21/2017
3
+
ms.date: 12/14/2020
4
4
ms.topic: "conceptual"
5
5
f1_keywords: ["C26401"]
6
6
helpviewer_keywords: ["C26401"]
7
7
ms.assetid: b9d3d398-697a-4a5d-8bfe-9c667dffb90b
8
-
description: CppCoreCheck rule that enforces C++ Core Guidelines I.11
8
+
description: CppCoreCheck rule C26401 enforces C++ Core Guidelines I.11
9
9
---
10
10
# C26401 DONT_DELETE_NON_OWNER
11
11
12
-
This check detects places where moving to `owner<T>` can be a good option for the first stage of refactoring. Like C26400 it enforces rules I.11 and R.3, but focuses on the "release" portion of the pointer lifetime. It warns on any call to operator **`delete`** if its target is neither an `owner<T>`nor an implicitly assumed owner. For more information, see [C26400](c26400.md) regarding the **`auto`** declarations. This does include expressions that refer to global variables, formals, and so on.
12
+
This check detects places where moving to `owner<T>` can be a good option for the first stage of refactoring. Like C26400, it enforces rules I.11 and R.3, but focuses on the "release" portion of the pointer lifetime. It warns on any call to operator **`delete`** if its target isn't an `owner<T>`or an implicitly assumed owner. For more information about **`auto`** declarations, see [C26400](c26400.md). This check includes expressions that refer to global variables, formal parameters, and so on.
13
13
14
-
Warnings C26400 and C26401 always occur with [C26409](c26409.md), but they are more appropriate for scenarios where immediate migration to smart pointers is not feasible. In such cases the `owner<T>` concept can be adopted first and C26409 may be temporarily suppressed.
14
+
Warnings C26400 and C26401 always occur with [C26409](c26409.md), but they're more appropriate for scenarios where immediate migration to smart pointers isn't feasible. In such cases, the `owner<T>` concept can be adopted first, and C26409 may be temporarily suppressed.
There's a C++ idiom, `delete this`, that triggers this warning. The warning is intentional, because the C++ Core Guidelines discourage this pattern. You can suppress the warning by using the `gsl::suppress` attribute, as shown in this example:
> `Avoid calling new and delete explicitly, use std::make_unique<T> instead (r.11).`
13
13
14
-
Even if code is clean of calls to`malloc()` and `free()`, we still suggest that you consider better options than explicit use of operators [`new` and `delete`](../cpp/new-and-delete-operators.md).
14
+
Even if code is clean of calls to`malloc` and `free`, we still suggest that you consider better options than explicit use of operators [`new` and `delete`](../cpp/new-and-delete-operators.md).
15
15
16
16
**C++ Core Guidelines**:\
17
17
[R.11: Avoid calling new and delete explicitly](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#r11-avoid-calling-new-and-delete-explicitly)
@@ -22,7 +22,7 @@ The ultimate fix is to use smart pointers and appropriate factory functions, suc
22
22
23
23
- The checker warns on calls to any kind of operator **`new`** or **`delete`**: scalar, vector, overloaded versions (global and class-specific), and placement versions. The placement **`new`** case may require some clarifications in the Core Guidelines for suggested fixes, and may be omitted in the future.
24
24
25
-
## Example
25
+
## Examples
26
26
27
27
This example shows C26409 is raised for explicit **`new`** and **`delete`**. Consider using smart pointer factory functions such as `std::make_unique` instead.
28
28
@@ -35,3 +35,24 @@ void f(int i)
35
35
auto unique = std::make_unique<int[]>(i); // prefer using smart pointers over new and delete
36
36
}
37
37
```
38
+
39
+
There's a C++ idiom, `delete this`, that triggers this warning. The warning is intentional, because the C++ Core Guidelines discourage this pattern. You can suppress the warning by using the `gsl::suppress` attribute, as shown in this example:
Copy file name to clipboardExpand all lines: docs/code-quality/how-to-specify-additional-code-information-by-using-analysis-assume.md
+15-16Lines changed: 15 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,34 +1,33 @@
1
1
---
2
-
description: "Learn more about: How to: Specify Additional Code Information by Using _Analysis_assume"
3
-
title: "Use _Analysis_assume for code analysis hints"
4
-
ms.date: 11/04/2016
2
+
description: "Learn more about how to specify additional code information by using _Analysis_assume_."
3
+
title: "Use _Analysis_assume_ for code analysis hints"
4
+
ms.date: 12/16/2020
5
5
ms.topic: "conceptual"
6
6
f1_keywords:
7
-
- "_Analysis_assume"
7
+
- "_Analysis_assume_"
8
8
helpviewer_keywords:
9
-
- "_Analysis_assume"
10
-
ms.assetid: 51205d97-4084-4cf4-a5ed-3eeaf67deb1b
9
+
- "_Analysis_assume_"
11
10
---
12
-
# How to: Specify Additional Code Information by Using _Analysis_assume
11
+
# How to specify additional code information by using `_Analysis_assume_`
13
12
14
-
You can provide hints to the code analysis tool for C/C++ code that will help the analysis process and reduce warnings. To provide additional information, use the following function:
13
+
You can provide hints to the code analysis tool for C/C++ code that will help the analysis process and reduce warnings. To provide additional information, use the following function macro:
15
14
16
-
`_Analysis_assume(``expr``)`
15
+
`_Analysis_assume(expr)`
17
16
18
-
`expr` - any expression that is assumed to evaluate to true.
17
+
*`expr`* - any expression that is assumed to evaluate to true.
19
18
20
-
The code analysis tool assumes that the condition represented by the expression is true at the point where the function appears and remains true until expression is altered, for example, by assignment to a variable.
19
+
The code analysis tool assumes that the condition represented by the expression *`expr`*is true at the point where the function appears. And, it remains true until *`expr`* is altered, for example, by assignment to a variable.
21
20
22
21
> [!NOTE]
23
-
> `_Analysis_assume` does not impact code optimization. Outside the code analysis tool, `_Analysis_assume` is defined as a no-op.
22
+
> `_Analysis_assume_` does not impact code optimization. Outside the code analysis tool, `_Analysis_assume_` is defined as a no-op.
24
23
25
24
## Example
26
25
27
-
The following code uses `_Analysis_assume` to correct the code analysis warning [C6388](../code-quality/c6388.md):
26
+
The following code uses `_Analysis_assume_` to correct the code analysis warning [C6388](../code-quality/c6388.md):
Copy file name to clipboardExpand all lines: docs/code-quality/using-the-cpp-core-guidelines-checkers.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Using the C++ Core Guidelines checkers
3
3
description: "How to set up and use the Microsoft C++ Code Analysis rules for C++ Core Guidelines."
4
-
ms.date: 07/27/2020
4
+
ms.date: 12/16/2020
5
5
ms.topic: "conceptual"
6
6
dev_langs:
7
7
- CPP
@@ -297,13 +297,13 @@ Code Analysis requires a few environment variables and compiler command-line opt
297
297
-`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.
298
298
-`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.
299
299
300
-
-**Commandline options**
300
+
-**Command-line options**
301
301
-**`/analyze`** Enables code analysis (consider also using **`/analyze:only`** and **`/analyze:quiet`**).
302
302
-**`/analyze:plugin EspXEngine.dll`** This option loads the Code Analysis Extensions engine into the PREfast. This engine, in turn, loads the C++ Core Guidelines Checker.
303
303
304
304
## Use the Guideline Support Library
305
305
306
-
The Guideline Support Library (GSL) is designed to help you follow the Core Guidelines. The GSL includes definitions that let you replace error-prone constructs with safer alternatives. For example, you can replace a `T*, length` pair of parameters with the `span<T>` type. The GSL is available at [http://www.nuget.org/packages/Microsoft.Gsl](https://www.nuget.org/packages/Microsoft.Gsl). The library is open-source, so you can view the sources, make comments, or contribute. The project can be found at [https://github.com/Microsoft/GSL](https://github.com/Microsoft/GSL).
306
+
The Guideline Support Library (GSL) is designed to help you follow the Core Guidelines. The GSL includes definitions that let you replace error-prone constructs with safer alternatives. For example, you can replace a `T*, length` pair of parameters with the `span<T>` type. The GSL project is available on GitHub at [https://github.com/Microsoft/GSL](https://github.com/Microsoft/GSL). The library is open-source, so you can view the sources, make comments, or contribute. You can also use the [vcpkg](../build/vcpkg.md) package manager to download and install the library locally.
0 commit comments