Skip to content

Commit 040e7c1

Browse files
committed
Fix warnings.
1 parent 62c3fd1 commit 040e7c1

File tree

8 files changed

+13
-13
lines changed

8 files changed

+13
-13
lines changed

docs/code-quality/c26441.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The standard library provides locks to help control concurrent access to resourc
1919

2020
This diagnostic only analyzes the standard lock types `std::scoped_lock`, `std::unique_lock`, and `std::lock_guard`. Warning [C26444](c26444.md) covers other unnamed RAII types.
2121

22-
The analyzer only analyzes simple calls to constructors. More complex initializer expressions may lead to inaccurate results in the form of missed warnings. Locks passed as arguments to function calls or returned as results of function calls are ignored because the analysis tool is unable to determine if those locks are deliberately trying to protect that function call or if they should be extended. To provide similar protection for types returned by a function call, annotate them with `[[nodiscard]]`. You can also annotate constructors with `[[nodiscard]]` to avoid unnamed objects of that type. The analyzer ignores locks created as temporaries but assigned to named references to extend their lifetime.
22+
The analyzer only analyzes simple calls to constructors. More complex initializer expressions may lead to inaccurate results in the form of missed warnings. The analyzer ignores locks passed as arguments to function calls or returned from function calls. It is unable to determine if those locks are deliberately trying to protect that function call or if they should be extended. To provide similar protection for types returned by a function call, annotate them with `[[nodiscard]]`. You can also annotate constructors with `[[nodiscard]]` to avoid unnamed objects of that type. The analyzer ignores locks created as temporaries but assigned to named references to extend their lifetime.
2323

2424
Code analysis name: `NO_UNNAMED_GUARDS`
2525

docs/code-quality/c26444.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ helpviewer_keywords: ["C26444"]
1313

1414
[ES.84: Don't (try to) declare a local variable with no name](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-noname)
1515

16-
Unnamed (that is, temporary) objects with non-trivial behavior may point to either (a) inefficient code that allocates and immediately throws away resources or (b) to the code that unintentionally ignores non-primitive data. Sometimes it may also indicate plainly wrong declaration.
16+
Unnamed temporary objects with nontrivial behavior may point to either (a) inefficient code that allocates and immediately throws away resources or (b) to the code that unintentionally ignores nonprimitive data. Sometimes it may also indicate plainly wrong declaration.
1717

1818
## Remarks
1919

20-
- This rule detects types with non-trivial destructors. Keep in mind that destructors can be compiler generated.
21-
- The warning can flag code that invokes either a non-trivial constructor of a RAII type.
20+
- This rule detects types with nontrivial destructors. Keep in mind that destructors can be compiler generated.
21+
- The warning can flag code that invokes either a nontrivial constructor of a RAII type.
2222
- The logic skips temporaries if they're used in higher-level expressions. One example is temporaries that are passed as arguments or used to invoke a function.
2323

2424
Code analysis name: `NO_UNNAMED_RAII_OBJECTS`

docs/code-quality/c26449.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Warning C26449
33
description: "Learn more about: Warning C26449 NO_SPAN_FROM_TEMPORARY"
4-
ms.date: 05/11/2024
4+
ms.date: 05/11/2023
55
f1_keywords: ["C26449", "NO_SPAN_FROM_TEMPORARY"]
66
helpviewer_keywords: ["C26449"]
77
---
@@ -13,7 +13,7 @@ C++ Core Guidelines: [GSL.view: Views](https://isocpp.github.io/CppCoreGuideline
1313

1414
Spans and views are convenient and lightweight types that allow you to reference memory buffers. But they must be used carefully: while their interface looks similar to standard containers, their behavior is more like the behavior of pointers and references. They don't own data and must never be constructed from temporary buffers. This check focuses on cases where source data is temporary, while a span or view isn't. This rule can help to avoid subtle but dangerous mistakes made when legacy code gets modernized and adopts spans or views. There's another check that handles a slightly different scenario involving span references: [C26445 NO_SPAN_REF](c26445.md).
1515

16-
Consider using [C26815](c26815.md) and [C26816](c26816.md). Those are more general versions of this check.
16+
Consider using [C26815](c26815.md) and [C26816](c26816.md). Those warnings are more general versions of this warning.
1717

1818
## Remarks
1919

@@ -53,7 +53,7 @@ void run_batch()
5353
}
5454
```
5555
56-
To fix the issue, make sure the view is created from an object that lives at least as long as the view itself. Sometimes this can be achieved by copying the data, other times some APIs need to be redesigned.
56+
To fix the issue, make sure the view is created from an object that lives at least as long as the view itself. Sometimes a solution can be achieved by copying the data, other times some APIs need to be redesigned.
5757
5858
## See also
5959
[C26815](c26815.md)\

docs/code-quality/c26453.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ helpviewer_keywords: ["C26453"]
1111
1212
## Remarks
1313

14-
This warning indicates the code left shifts a negative signed integral value, which is non-portable and triggers implementation defined behavior.
14+
This warning indicates the code left shifts a negative signed integral value, which is nonportable and triggers implementation defined behavior.
1515

1616
Code analysis name: `LEFTSHIFT_NEGATIVE_SIGNED_NUMBER`
1717

docs/code-quality/c26495.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ helpviewer_keywords: ["C26495"]
1313

1414
A member variable isn't initialized by a constructor or by an initializer. Make sure all variables are initialized by the end of construction. For more information, see C++ Core Guidelines [Type.6](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#SS-type) and [C.48](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#c48-prefer-in-class-initializers-to-member-initializers-in-constructors-for-constant-initializers).
1515

16-
This check is intra-procedural. Whenever there is a function call to a non-const member function, the check assumes that this member function will initialize all of the members. This heuristic can result in missed errors and is in place to avoid false positive results. Moreover, when a member is passed by non-const reference to a function, the check assumes that the function will initialize the member.
16+
This check is intra-procedural. Whenever there is a function call to a nonconst member function, the check assumes that this member function initializes all of the members. This heuristic can result in missed errors and is in place to avoid false positive results. Moreover, when a member is passed by nonconst reference to a function, the check assumes that the function initializes the member.
1717

1818
Code analysis name: `MEMBER_UNINIT`
1919

docs/code-quality/c26810.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Code analysis name: `COROUTINES_USE_AFTER_FREE_CAPTURE`
1717

1818
## Example
1919

20-
The following code will generate C26810.
20+
The following code generates C26810.
2121

2222
```cpp
2323
#include <experimental/generator>

docs/code-quality/c26811.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ helpviewer_keywords: ["C26811"]
1111
1212
## Remarks
1313

14-
Warning C26811 is triggered when a variables might be used after its lifetime ended in a resumed coroutine.
14+
Warning C26811 is triggered when a variable might be used after its lifetime ended in a resumed coroutine.
1515

1616
Code analysis name: `COROUTINES_USE_AFTER_FREE_PARAM`
1717

1818
## Example
1919

20-
The following code will generate C26811.
20+
The following code generates C26811.
2121

2222
```cpp
2323
#include <experimental/generator>

docs/code-quality/c26819.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ For more information, see [ES.78: Don't rely on implicit fallthrough in `switch`
1717

1818
## Example
1919

20-
In this sample, implicit fallthrough occurs from a non-empty switch case into a following case.
20+
In this sample, implicit fallthrough occurs from a nonempty switch case into a following case.
2121

2222
```cpp
2323
void fn1();

0 commit comments

Comments
 (0)