Skip to content

Commit f9f76b5

Browse files
committed
Address review comments.
1 parent 1763386 commit f9f76b5

File tree

9 files changed

+9
-9
lines changed

9 files changed

+9
-9
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. 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:
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 their [lifetime should be extended](https://abseil.io/tips/107). 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:
2323

2424
```cpp
2525
struct X { [[nodiscard]] X(); };

docs/code-quality/c26444.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ 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-
An unnamed variable declaration will create a temporary object that is discarded at the end of the statement. Such 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.
16+
An unnamed variable declaration creates a temporary object that is discarded at the end of the statement. Such temporary objects with nontrivial behavior may point to either inefficient code that allocates and immediately throws away resources or to the code that unintentionally ignores nonprimitive data. Sometimes it may also indicate plainly wrong declaration.
1717

1818
## Remarks
1919

docs/code-quality/c26449.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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 a solution 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 to share a reference to an object that lives long enough instead of returning a temporary copy.
5757
5858
## See also
5959
[C26815](c26815.md)\

docs/code-quality/c26450.md

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

1414
This warning indicates that an arithmetic operation was provably lossy at compile time. It can be asserted when the operands are all compile-time constants. Currently, we check left shift, multiplication, addition, and subtraction operations for such overflows.
1515

16-
Warning [C4307](https://learn.microsoft.com/cpp/error-messages/compiler-warnings/compiler-warning-level-2-c4307) is a similar check in the Microsoft C++ compiler.
16+
Warning [C4307](../error-messages/compiler-warnings/compiler-warning-level-2-c4307.md) is a similar check in the Microsoft C++ compiler.
1717

1818
Code analysis name: `RESULT_OF_ARITHMETIC_OPERATION_PROVABLY_LOSSY`
1919

docs/code-quality/c26452.md

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

1414
This warning indicates the shift count is negative, or greater than or equal to the number of bits in the shifted operand. Either case results in undefined behavior.
1515

16-
Warning [C4293](https://learn.microsoft.com/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4293) is a similar check in the Microsoft C++ compiler.
16+
Warning [C4293](../error-messages/compiler-warnings/compiler-warning-level-1-c4293.md) is a similar check in the Microsoft C++ compiler.
1717

1818
Code analysis name: `SHIFT_COUNT_NEGATIVE_OR_TOO_BIG`
1919

docs/code-quality/c26494.md

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

14-
This check requires each local variable to be initialized at the declaration or in the following statement.
14+
This check requires local variables to be initialized at the declaration or in the following statement.
1515

1616
## Example
1717

docs/code-quality/c26815.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ helpviewer_keywords: ["C26815"]
1515

1616
The created pointer or view refers to an unnamed temporary object that is destroyed at the end of the statement. The pointer or view will dangle.
1717

18-
This check recognizes views and owners from the STL. To teach this check about user-authored types, use the `[[msvc::lifetimebound]]` annotation.
18+
This check recognizes views and owners from the C++ Standard Template Library (STL). To teach this check about user-authored types, use the `[[msvc::lifetimebound]]` annotation.
1919
The `[[msvc::lifetimebound]]` support is new in MSVC 17.7.
2020

2121
Code analysis name: `LIFETIME_LOCAL_USE_AFTER_FREE_TEMP`

docs/code-quality/c26816.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ helpviewer_keywords: ["C26816"]
1515

1616
The pointer points to a variable that is allocated on the stack. When the variable goes out of scope it's cleaned up, which causes the pointer to be invalid.
1717

18-
This check recognizes views and owners from the STL. To teach this check about user-authored types, use the `[[msvc::lifetimebound]]` annotation.
18+
This check recognizes views and owners from the C++ Standard Template Library (STL). To teach this check about user-authored types, use the `[[msvc::lifetimebound]]` annotation.
1919
The `[[msvc::lifetimebound]]` support is new in MSVC 17.7.
2020

2121
Code analysis name: `LIFETIME_LOCAL_USE_AFTER_FREE_STACK`

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 nonempty 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)