Skip to content

Commit fc2b42d

Browse files
authored
Merge pull request #5203 from Rageking8/tweaks-for-c6030-warning-page
Tweaks for C6030 warning page
2 parents 305ef0c + 423c0f3 commit fc2b42d

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

docs/code-quality/c6030.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,32 @@ f1_keywords: ["C6030", "USE_ATTRIBUTE_NORETURN", "__WARNING_USE_ATTRIBUTE_NORETU
66
helpviewer_keywords: ["C6030"]
77
---
88

9-
# Warning C6030
9+
# Warning C6030
1010

1111
> Use attribute [[noreturn]] over __declspec(noreturn) in function '*function-name*'
1212
1313
## Remarks
1414

15-
This warning suggests using the C++11 standard attribute `[[noreturn]]` in place of the declspec variant `__declspec(noreturn)`. The standard attribute provides better cross-platform support because it doesn't rely on language extensions.
15+
This warning suggests using the C++11 standard attribute [`[[noreturn]]`](../cpp/attributes.md#noreturn) in place of the declspec variant [`__declspec(noreturn)`](../cpp/noreturn.md). The standard attribute provides better cross-platform support because it doesn't rely on language extensions.
1616

1717
This warning is off by default and isn't part of the `All Rules` rule set. To enable this warning, it must be added to the rule set file being used.
1818

1919
This check is available in Visual Studio 2022 version 17.0 and later versions.
20+
2021
Code analysis name: `USE_ATTRIBUTE_NORETURN`
2122

2223
## Example
2324

2425
The following code generates C6030:
2526

2627
```cpp
27-
__declspec(noreturn) void TerminateApplication();
28-
28+
__declspec(noreturn) void terminate_application();
2929
```
3030
3131
Fix the issue by using the `[[noreturn]]` attribute:
3232
3333
```cpp
34-
[[ noreturn ]] void TerminateApplication();
35-
34+
[[noreturn]] void terminate_application();
3635
```
3736

3837
## See also

0 commit comments

Comments
 (0)