Skip to content

Commit db9dfb2

Browse files
authored
Merge pull request #5803 from Rageking8/structure-warning-references-in-range-c26100-c26167
Structure warning references in range [C26100, C26167]
2 parents e68b2dd + 1e38532 commit db9dfb2

File tree

16 files changed

+42
-31
lines changed

16 files changed

+42
-31
lines changed

docs/code-quality/c26100.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
2+
title: "Warning C26100"
23
description: "Learn more about: Warning C26100"
3-
title: Warning C26100
44
ms.date: 11/04/2016
55
f1_keywords: ["C26100", "RACE_CONDITION", "__WARNING_RACE_CONDITION"]
66
helpviewer_keywords: ["C26100"]
7-
ms.assetid: 470ab2b2-5b55-424f-b192-3863a773c892
87
---
98
# Warning C26100
109

docs/code-quality/c26101.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
---
2+
title: "Warning C26101"
23
description: "Learn more about: Warning C26101"
3-
title: Warning C26101
44
ms.date: 11/04/2016
55
f1_keywords: ["C26101"]
66
helpviewer_keywords: ["C26101"]
7-
ms.assetid: 86046553-09ec-40ce-82b3-fd641928f0b0
87
---
98
# Warning C26101
109

1110
> Failing to use interlocked operation properly for variable '*var*'.
1211
12+
## Remarks
13+
1314
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.
1415

1516
## Example

docs/code-quality/c26105.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
---
2+
title: "Warning C26105"
23
description: "Learn more about: Warning C26105"
3-
title: Warning C26105
44
ms.date: 11/04/2016
55
f1_keywords: ["C26105"]
66
helpviewer_keywords: ["C26105"]
7-
ms.assetid: 5558a3db-0513-43b4-8579-ccdc17e2b92f
87
---
98
# Warning C26105
109

1110
> Lock order violation. Acquiring lock '*lock*' with level '*level*' causes order inversion.
1211
12+
## Remarks
13+
1314
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.
1415

1516
## Example

docs/code-quality/c26110.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
---
2+
title: "Warning C26110"
23
description: "Learn more about: Warning C26110"
3-
title: Warning C26110
44
ms.date: 10/01/2019
55
f1_keywords: ["C26110"]
66
helpviewer_keywords: ["C26110"]
7-
ms.assetid: d82b79ec-6d7f-438b-bd6a-da874a3e08e5
87
---
98
# Warning C26110
109

1110
> Caller failing to hold lock '*lock*' before calling function '*func*'.
1211
12+
## Remarks
13+
1314
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)
1415

1516
## Example

docs/code-quality/c26111.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
---
2+
title: "Warning C26111"
23
description: "Learn more about: Warning C26111"
3-
title: Warning C26111
44
ms.date: 11/04/2016
55
f1_keywords: ["C26111"]
66
helpviewer_keywords: ["C26111"]
7-
ms.assetid: 85fc740a-3bbb-41b8-a848-95e243a08da9
87
---
98
# Warning C26111
109

1110
> Caller failing to release lock '*lock*' before calling function '*func*'.
1211
12+
## Remarks
13+
1314
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.
1415

1516
## Example

docs/code-quality/c26112.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
---
2+
title: "Warning C26112"
23
description: "Learn more about: Warning C26112"
3-
title: Warning C26112
44
ms.date: 11/04/2016
55
f1_keywords: ["C26112"]
66
helpviewer_keywords: ["C26112"]
7-
ms.assetid: 926de738-b9b0-43d7-9137-ab2daa44ad4d
87
---
98
# Warning C26112
109

1110
> Caller cannot hold any lock before calling '*func*'.
1211
12+
## Remarks
13+
1314
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.
1415

1516
## Example

docs/code-quality/c26115.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
---
2+
title: "Warning C26115"
23
description: "Learn more about: Warning C26115"
3-
title: Warning C26115
44
ms.date: 11/04/2016
55
f1_keywords: ["C26115"]
66
helpviewer_keywords: ["C26115"]
7-
ms.assetid: 3977a2bb-d1fe-4510-89dd-07fdc69e911c
87
---
98
# Warning C26115
109

1110
> Failing to release lock '*lock*' in function '*func*'.
1211
12+
## Remarks
13+
1314
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.
1415

1516
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.

docs/code-quality/c26117.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
---
2+
title: "Warning C26117"
23
description: "Learn more about: Warning C26117"
3-
title: Warning C26117
44
ms.date: 11/04/2016
55
f1_keywords: ["C26117"]
66
helpviewer_keywords: ["C26117"]
7-
ms.assetid: cc7ebc8d-9826-4cad-a4d5-2d3ad5896734
87
---
98
# Warning C26117
109

1110
> Releasing unheld lock '*lock*' in function '*func*'.
1211
12+
## Remarks
13+
1314
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.
1415

1516
## Examples

docs/code-quality/c26130.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
---
2+
title: "Warning C26130"
23
description: "Learn more about: Warning C26130"
3-
title: Warning C26130
44
ms.date: 11/04/2016
55
f1_keywords: ["C26130"]
66
helpviewer_keywords: ["C26130"]
7-
ms.assetid: 535e2356-bc84-4549-983d-7d29aee2249c
87
---
98
# Warning C26130
109

1110
> 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*'.
1211
12+
## Remarks
13+
1314
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.
1415

1516
## Examples

docs/code-quality/c26135.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
---
2+
title: "Warning C26135"
23
description: "Learn more about: Warning C26135"
3-
title: Warning C26135
44
ms.date: 11/04/2016
55
f1_keywords: ["C26135"]
66
helpviewer_keywords: ["C26135"]
7-
ms.assetid: e9515189-8d21-473b-89f4-8b92ebd3a4f1
87
---
98
# Warning C26135
109

1110
> Missing annotation '*annotation*' at function '*func*'.
1211
12+
## Remarks
13+
1314
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).
1415

1516
## Examples

0 commit comments

Comments
 (0)