Skip to content

Commit 843e988

Browse files
authored
Merge pull request #5261 from Rageking8/add-example-for-c28020-warning
Add example for C28020 warning
2 parents 723a3a7 + fba2168 commit 843e988

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

docs/code-quality/c28020.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,32 @@
11
---
2-
description: "Learn more about: Warning C28020"
32
title: Warning C28020
4-
ms.date: 11/04/2016
3+
description: "Learn more about: Warning C28020"
4+
ms.date: 03/25/2025
55
f1_keywords: ["C28020"]
66
helpviewer_keywords: ["C28020"]
7-
ms.assetid: 3612185a-0858-4ba9-b795-4a0681073cf7
87
---
98
# Warning C28020
109

11-
> The expression '*expr*' is not true at this call
10+
> The expression '*expr*' is not true at this call.
1211
1312
This warning is reported when the `_Satisfies_` expression listed isn't true. Frequently, the warning indicates an incorrect parameter.
1413

1514
If this warning occurs on a function declaration, the annotations indicate an impossible condition.
15+
16+
## Example
17+
18+
The following example generates C28020:
19+
20+
```cpp
21+
#include <sal.h>
22+
23+
int func(_In_range_(0, 10) int value)
24+
{
25+
return value;
26+
}
27+
28+
int main()
29+
{
30+
func(11); // C28020
31+
}
32+
```

0 commit comments

Comments
 (0)