Skip to content

Commit

Permalink
Merge pull request #4205 from MicrosoftDocs/main638007617037431922syn…
Browse files Browse the repository at this point in the history
…c_temp

Repo sync for protected CLA branch
  • Loading branch information
colin-home committed Oct 7, 2022
2 parents 5123d86 + 0f515ba commit 6b1e5f6
Show file tree
Hide file tree
Showing 400 changed files with 2,718 additions and 2,459 deletions.
1 change: 0 additions & 1 deletion docs/code-quality/c1250.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
description: "Learn more about: Fatal error C1250"
title: Fatal error C1250
ms.date: 10/04/2022
ms.topic: reference
f1_keywords: ["C1250", "FATALERROR_UnableToLoadPlugin"]
helpviewer_keywords: ["C1250"]
ms.assetid: 3f2385d7-e0d6-4574-8cea-342e82d0aea4
Expand Down
1 change: 0 additions & 1 deletion docs/code-quality/c1251.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
description: "Learn more about: Fatal error C1251"
title: Fatal error C1251
ms.date: 10/04/2022
ms.topic: reference
f1_keywords: ["C1251", "FATALERROR_UnableToLoadModel"]
helpviewer_keywords: ["C1251"]
ms.assetid: 0b46e0a5-c290-48d8-ba4e-f526ae68993b
Expand Down
1 change: 0 additions & 1 deletion docs/code-quality/c1252.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
description: "Learn more about: Fatal error C1252"
title: Fatal error C1252
ms.date: 10/04/2022
ms.topic: reference
f1_keywords: ["C1252", "FATALERROR_CircularDependency"]
helpviewer_keywords: ["C1252"]
ms.assetid: e88bf199-890d-4582-bb5c-c1238797145b
Expand Down
1 change: 0 additions & 1 deletion docs/code-quality/c1253.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
description: "Learn more about: Fatal error C1253"
title: Fatal error C1253
ms.date: 10/04/2022
ms.topic: reference
f1_keywords: ["C1253", "FATALERROR_UnableToLoadModelFile"]
helpviewer_keywords: ["C1253"]
ms.assetid: 21a4062f-fde8-40e5-8dbd-6f892926d3d2
Expand Down
1 change: 0 additions & 1 deletion docs/code-quality/c1254.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
description: "Learn more about: Fatal error C1254"
title: Fatal error C1254
ms.date: 10/04/2022
ms.topic: reference
f1_keywords: ["C1254", "FATALERROR_PluginVersionMismatch"]
helpviewer_keywords: ["C1254"]
ms.assetid: cb1377cf-869e-432d-941f-71f77134f97a
Expand Down
1 change: 0 additions & 1 deletion docs/code-quality/c1255.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
description: "Learn more about: Fatal error C1255"
title: Fatal error C1255
ms.date: 10/04/2022
ms.topic: reference
f1_keywords: ["C1255", "FATALERROR_PCHSyncLost"]
helpviewer_keywords: ["C1255"]
ms.assetid: a97da6bd-06dc-42bf-9158-0de1ebb90d4a
Expand Down
1 change: 0 additions & 1 deletion docs/code-quality/c1256.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
description: "Learn more about: Fatal error C1256"
title: Fatal error C1256
ms.date: 10/04/2022
ms.topic: reference
f1_keywords: ["C1256", "FATALERROR_PCHInconsistent"]
helpviewer_keywords: ["C1256"]
ms.assetid: 4d65e495-f9d9-435c-ba51-1cf5b4cc2309
Expand Down
1 change: 0 additions & 1 deletion docs/code-quality/c1257.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
description: "Learn more about: Fatal error C1257"
title: Fatal error C1257
ms.date: 10/04/2022
ms.topic: reference
f1_keywords: ["C1257", "FATALERROR_InitFailure"]
helpviewer_keywords: ["C1257"]
ms.assetid: 38d3ec05-01ba-42b3-aac6-077e92bf2ded
Expand Down
1 change: 0 additions & 1 deletion docs/code-quality/c1258.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
description: "Learn more about: Fatal error C1258"
title: Fatal error C1258
ms.date: 10/04/2022
ms.topic: reference
f1_keywords: ["C1258", "FATALERROR_SaveToXmlFailed"]
helpviewer_keywords: ["C1258"]
---
Expand Down
1 change: 0 additions & 1 deletion docs/code-quality/c1259.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
description: "Learn more about: Fatal error C1259"
title: Fatal error C1259
ms.date: 10/04/2022
ms.topic: reference
f1_keywords: ["C1259", "FATALERROR_FatalError"]
helpviewer_keywords: ["C1259"]
---
Expand Down
1 change: 0 additions & 1 deletion docs/code-quality/c1260.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
description: "Learn more about: Fatal error C1260"
title: Fatal error C1260
ms.date: 10/04/2022
ms.topic: reference
f1_keywords: ["C1260", "FATALERROR_DuplicateId"]
helpviewer_keywords: ["C1260"]
---
Expand Down
17 changes: 10 additions & 7 deletions docs/code-quality/c26100.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
---
description: "Learn more about: C26100"
title: C26100
description: "Learn more about: Warning C26100"
title: Warning C26100
ms.date: 11/04/2016
ms.topic: reference
f1_keywords: ["C26100"]
f1_keywords: ["C26100", "RACE_CONDITION", "__WARNING_RACE_CONDITION"]
helpviewer_keywords: ["C26100"]
ms.assetid: 470ab2b2-5b55-424f-b192-3863a773c892
---
# C26100
# Warning C26100

> warning C26100: Race condition. Variable \<var> should be protected by lock \<lock>.
> Race condition. Variable '*var*' should be protected by lock '*lock*'.
## Remarks

The `_Guarded_by_` annotation in the code specifies the lock to use to guard a shared variable. Warning C26100 is generated when the guard contract is violated.

Code analysis name: `RACE_CONDITION`

## Examples

The following example generates warning C26100 because there is a violation of the `_Guarded_by_` contract.
The following example generates warning C26100 because there's a violation of the `_Guarded_by_` contract.

```cpp
CRITICAL_SECTION gCS;
Expand Down
13 changes: 6 additions & 7 deletions docs/code-quality/c26101.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
---
description: "Learn more about: C26101"
title: C26101
description: "Learn more about: Warning C26101"
title: Warning C26101
ms.date: 11/04/2016
ms.topic: reference
f1_keywords: ["C26101"]
helpviewer_keywords: ["C26101"]
ms.assetid: 86046553-09ec-40ce-82b3-fd641928f0b0
---
# C26101
# Warning C26101

> warning C26101: Failing to use interlocked operation properly for variable \<var>.
> Failing to use interlocked operation properly for variable '*var*'.
Windows APIs offer a variety of interlocked operations. Annotation `_Interlocked_` specifies that a variable should only be accessed through an interlocked operation. Warning C26101 is issued when an access is not consistent with the `_Interlocked_` annotation.
Windows APIs offer various interlocked operations. Annotation `_Interlocked_` specifies that a variable should only be accessed through an interlocked operation. Warning C26101 is issued when a variable access isn't consistent with the `_Interlocked_` annotation.

## Example

The following example generates warning C26101 because there is a violation of the `_Interlocked_` contract.
The following example generates warning C26101 because there's a violation of the `_Interlocked_` contract.

```cpp
CRITICAL_SECTION cs;
Expand Down
11 changes: 5 additions & 6 deletions docs/code-quality/c26105.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
---
description: "Learn more about: C26105"
title: C26105
description: "Learn more about: Warning C26105"
title: Warning C26105
ms.date: 11/04/2016
ms.topic: reference
f1_keywords: ["C26105"]
helpviewer_keywords: ["C26105"]
ms.assetid: 5558a3db-0513-43b4-8579-ccdc17e2b92f
---
# C26105
# Warning C26105

> warning C26105: Lock order violation. Acquiring lock \<lock> with level \<level> causes order inversion.
> Lock order violation. Acquiring lock '*lock*' with level '*level*' causes order inversion.
Concurrency SAL supports *lock levels*. To declare a lock level, which is denoted by a string literal without double quotes, use `_Create_lock_level_`. You can impose an order of acquisition between two lock levels by using the annotation `_Set_lock_level_order_(A,B)`, which states that locks that have level `A` must be acquired before locks that have level `B`. To establish a lock order hierarchy (a partial order among lock levels), use multiple `_Set_lock_level_order_` annotations. To associate a lock with a lock level, use the `_Set_lock_level_` annotation when you declare the lock. Warning C26105 is issued when a lock ordering violation is detected.

## Example

The following example generates warning C26105 because there is a lock order inversion in the function `OrderInversion`.
The following example generates warning C26105 because there's a lock order inversion in the function `OrderInversion`.

```cpp
_Create_lock_level_(MutexLockLevel);
Expand Down
11 changes: 5 additions & 6 deletions docs/code-quality/c26110.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
---
description: "Learn more about: C26110"
title: C26110
description: "Learn more about: Warning C26110"
title: Warning C26110
ms.date: 10/01/2019
ms.topic: reference
f1_keywords: ["C26110"]
helpviewer_keywords: ["C26110"]
ms.assetid: d82b79ec-6d7f-438b-bd6a-da874a3e08e5
---
# C26110
# Warning C26110

> warning C26110: Caller failing to hold lock \<lock> before calling function \<func>.
> Caller failing to hold lock '*lock*' before calling function '*func*'.
When a lock is required, make sure to clarify whether the function itself or its caller should acquire the lock. Warning C26110 is issued when there is a violation of the `_Requires_lock_held_` annotation, or other lock-related annotations. For more information, see [Annotating Locking Behavior](annotating-locking-behavior.md)
When a lock is required, make sure to clarify whether the function itself, or its caller, should acquire the lock. Warning C26110 is issued when there's a violation of the `_Requires_lock_held_` annotation, or other lock-related annotations. For more information, see [Annotating Locking Behavior](annotating-locking-behavior.md)

## Example

Expand Down
11 changes: 5 additions & 6 deletions docs/code-quality/c26111.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
---
description: "Learn more about: C26111"
title: C26111
description: "Learn more about: Warning C26111"
title: Warning C26111
ms.date: 11/04/2016
ms.topic: reference
f1_keywords: ["C26111"]
helpviewer_keywords: ["C26111"]
ms.assetid: 85fc740a-3bbb-41b8-a848-95e243a08da9
---
# C26111
# Warning C26111

> warning C26111: Caller failing to release lock \<lock> before calling function \<func>.
> Caller failing to release lock '*lock*' before calling function '*func*'.
The annotation `_Requires_lock_not_held_` imposes a precondition that the lock count for the specified lock cannot be greater than zero when the function is called. Warning C26111 is issued when a function fails to release the lock before it calls another function.
The annotation `_Requires_lock_not_held_` imposes a precondition that the lock count for the specified lock can't be greater than zero when the function is called. Warning C26111 is issued when a function fails to release the lock before it calls another function.

## Example

Expand Down
9 changes: 4 additions & 5 deletions docs/code-quality/c26112.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
---
description: "Learn more about: C26112"
title: C26112
description: "Learn more about: Warning C26112"
title: Warning C26112
ms.date: 11/04/2016
ms.topic: reference
f1_keywords: ["C26112"]
helpviewer_keywords: ["C26112"]
ms.assetid: 926de738-b9b0-43d7-9137-ab2daa44ad4d
---
# C26112
# Warning C26112

> warning C26112: Caller cannot hold any lock before calling \<func>.
> Caller cannot hold any lock before calling '*func*'.
The annotation `_Requires_no_locks_held_` imposes a precondition that the caller must not hold any lock while it calls the function. Warning C26112 is issued when a function fails to release all locks before it calls another function.

Expand Down
15 changes: 7 additions & 8 deletions docs/code-quality/c26115.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
---
description: "Learn more about: C26115"
title: C26115
description: "Learn more about: Warning C26115"
title: Warning C26115
ms.date: 11/04/2016
ms.topic: reference
f1_keywords: ["C26115"]
helpviewer_keywords: ["C26115"]
ms.assetid: 3977a2bb-d1fe-4510-89dd-07fdc69e911c
---
# C26115
# Warning C26115

> warning C26115: Failing to release lock \<lock> in function \<func>.
> Failing to release lock '*lock*' in function '*func*'.
Enforcement of syntactically scoped lock *acquire* and lock *release* pairs in C/C++ programs is not performed by the language. A function may introduce a locking side effect by making an observable modification to the concurrency state. For example, a lock wrapper function increments the number of lock acquisitions, or lock count, for a given lock.
Enforcement of syntactically scoped lock *acquire* and lock *release* pairs in C/C++ programs isn't performed by the language. A function may introduce a locking side effect by making an observable modification to the concurrency state. For example, a lock wrapper function increments the number of lock acquisitions, or lock count, for a given lock.

You can annotate a function that has a side effect from a lock acquire or lock release by using `_Acquires_lock_` or `_Releases_lock_`, respectively. Without such annotations, a function is expected not to change any lock count after it returns. If acquires and releases are not balanced, they are considered to be *orphaned*. Warning C26115 is issued when a function introduces an orphaned lock.
You can annotate a function that has a side effect from a lock acquire or lock release by using `_Acquires_lock_` or `_Releases_lock_`, respectively. Without such annotations, a function is expected not to change any lock count after it returns. If acquires and releases aren't balanced, they're considered to be *orphaned*. Warning C26115 is issued when a function introduces an orphaned lock.

## Example

The following example generates warning C26115 because there is an orphaned lock in a function that is not annotated with `_Acquires_lock_`.
The following example generates warning C26115 because there's an orphaned lock in a function that isn't annotated with `_Acquires_lock_`.

```cpp
typedef struct _DATA
Expand Down
13 changes: 6 additions & 7 deletions docs/code-quality/c26116.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
---
description: "Learn more about: C26116"
title: C26116
description: "Learn more about: Warning C26116"
title: Warning C26116
ms.date: 11/04/2016
ms.topic: reference
f1_keywords: ["C26116"]
helpviewer_keywords: ["C26116"]
ms.assetid: 43e99d2c-405e-4913-b6bd-47f5858b2877
---
# C26116
# Warning C26116

> warning C26116: Failing to acquire or to hold lock \<lock> in \<func>.
> Failing to acquire or to hold lock '*lock*' in '*func*'.
Enforcement of syntactically scoped lock *acquire* and lock *release* pairs in C/C++ programs is not performed by the language. A function may introduce a locking side effect by making an observable modification to the concurrency state. For example, a lock wrapper function increments the number of lock acquisitions, or lock count, for a given lock.You can annotate a function that has a side effect from a lock acquire or lock release by using `_Acquires_lock_` or `_Requires_lock_held`, respectively. Without such annotations, a function is expected not to change any lock count after it returns. If acquires and releases are not balanced, they are considered to be *orphaned*. Warning C26116 is issued when a function has been annotated with `_Acquires_lock_`, but it does not acquire a lock, or when a function is annotated with `_Requires_lock_held` and releases the lock.
Enforcement of syntactically scoped lock *acquire* and lock *release* pairs in C/C++ programs isn't performed by the language. A function may introduce a locking side effect by making an observable modification to the concurrency state. For example, a lock wrapper function increments the number of lock acquisitions, or lock count, for a given lock. You can annotate a function that has a side effect from a lock acquire or lock release by using `_Acquires_lock_` or `_Requires_lock_held`, respectively. Without such annotations, a function is expected not to change any lock count after it returns. If acquires and releases aren't balanced, they're considered to be *orphaned*. Warning C26116 is issued when a function has been annotated with `_Acquires_lock_`, but it doesn't acquire a lock, or when a function is annotated with `_Requires_lock_held` and releases the lock.

## Example

The following example generates warning C26116 because the function `DoesNotLock` was annotated with `_Acquires_lock_` but does not acquire it. The function `DoesNotHoldLock` generates the warning because it is annotated with `_Requires_lock_held` and does not hold it.
The following example generates warning C26116 because the function `DoesNotLock` was annotated with `_Acquires_lock_` but doesn't acquire it. The function `DoesNotHoldLock` generates the warning because it's annotated with `_Requires_lock_held` and doesn't hold it.

```cpp
typedef struct _DATA
Expand Down
13 changes: 6 additions & 7 deletions docs/code-quality/c26117.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
---
description: "Learn more about: C26117"
title: C26117
description: "Learn more about: Warning C26117"
title: Warning C26117
ms.date: 11/04/2016
ms.topic: reference
f1_keywords: ["C26117"]
helpviewer_keywords: ["C26117"]
ms.assetid: cc7ebc8d-9826-4cad-a4d5-2d3ad5896734
---
# C26117
# Warning C26117

> warning C26117: Releasing unheld lock \<lock> in function \<func>.
> Releasing unheld lock '*lock*' in function '*func*'.
Enforcement of syntactically scoped lock *acquire* and lock *release* pairs in C/C++ programs is not performed by the language. A function may introduce a locking side effect by making an observable modification to the concurrency state. For example, a lock wrapper function increments the number of lock acquisitions, or lock count, for a given lock.You can annotate a function that has a side effect from a lock acquire or lock release by using `_Acquires_lock_` or `_Releases_lock_`, respectively. Without such annotations, a function is expected not to change any lock count after it returns. If acquires and releases are not balanced, they are considered to be *orphaned*. Warning C26117 is issued when a function that has not been annotated with `_Releases_lock_` releases a lock that it doesn't hold, because the function must own the lock before it releases it.
Enforcement of syntactically scoped lock *acquire* and lock *release* pairs in C/C++ programs isn't performed by the language. A function may introduce a locking side effect by making an observable modification to the concurrency state. For example, a lock wrapper function increments the number of lock acquisitions, or lock count, for a given lock. You can annotate a function that has a side effect from a lock acquire or lock release by using `_Acquires_lock_` or `_Releases_lock_`, respectively. Without such annotations, a function is expected not to change any lock count after it returns. If acquires and releases aren't balanced, they're considered to be *orphaned*. Warning C26117 is issued when a function that hasn't been annotated with `_Releases_lock_` releases a lock that it doesn't hold, because the function must own the lock before it releases it.

## Examples

The following example generates warning C26117 because the function `ReleaseUnheldLock` releases a lock that it doesn't necessarily hold—the state of `flag` is ambiguous—and there is no annotation that specifies that it should.
The following example generates warning C26117 because the function `ReleaseUnheldLock` releases a lock that it doesn't necessarily hold—the state of `flag` is ambiguous—and there's no annotation that specifies that it should.

```cpp

Expand Down
13 changes: 6 additions & 7 deletions docs/code-quality/c26130.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
---
description: "Learn more about: C26130"
title: C26130
description: "Learn more about: Warning C26130"
title: Warning C26130
ms.date: 11/04/2016
ms.topic: reference
f1_keywords: ["C26130"]
helpviewer_keywords: ["C26130"]
ms.assetid: 535e2356-bc84-4549-983d-7d29aee2249c
---
# C26130
# Warning C26130

> warning C26130: Missing annotation \_Requires\_lock\_held\_(\<lock>) or \_No\_competing\_thread\_ at function \<func>. Otherwise it could be a race condition. Variable \<var> should be protected by lock \<lock>.
> Missing annotation \_Requires\_lock\_held\_('*lock*') or \_No\_competing\_thread\_ at function '*func*'. Otherwise it could be a race condition. Variable '*var*' should be protected by lock '*lock*'.
Warning C26130 is issued when the analyzer detects a potential race condition but infers that the function is likely to be run in a single threaded mode, for example, when the function is in the initialization stage based on certain heuristics.
Warning C26130 is issued when the analyzer detects a potential race condition but infers that the function is likely to be run in a single threaded mode. For example, when the function is in the initialization stage, based on certain heuristics.

## Examples

Expand All @@ -30,7 +29,7 @@ void Init(DATA* p)
}
```
If the previous code is guaranteed to be operated in a single threaded mode, annotate the function by using `_No_competing_thread_`, as shown in the following example.
If the previous code is guaranteed to operate in single-threaded mode, annotate the function by using `_No_competing_thread_`, as shown in the following example.
```cpp
typedef struct _DATA
Expand Down
11 changes: 5 additions & 6 deletions docs/code-quality/c26135.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
---
description: "Learn more about: C26135"
title: C26135
description: "Learn more about: Warning C26135"
title: Warning C26135
ms.date: 11/04/2016
ms.topic: reference
f1_keywords: ["C26135"]
helpviewer_keywords: ["C26135"]
ms.assetid: e9515189-8d21-473b-89f4-8b92ebd3a4f1
---
# C26135
# Warning C26135

> warning C26135: Missing annotation \<annotation> at function \<func>.
> Missing annotation '*annotation*' at function '*func*'.
Warning C26135 is issued when the analyzer infers that a function is a lock wrapper function that has a lock acquire or lock release side effect. If the code is not intended to be a wrapper function, then either the lock is leaking (if the lock is being acquired) or it is being released incorrectly (if the lock is being released).
Warning C26135 is issued when the analyzer infers that a function is a lock wrapper function that has a "lock acquire" or "lock release" side effect. If the code isn't intended to be a wrapper function, then either the lock is leaking (if it's being acquired), or it's being released incorrectly (if the lock is being released).

## Examples

Expand Down
Loading

0 comments on commit 6b1e5f6

Please sign in to comment.