title | description | ms.date | f1_keywords | helpviewer_keywords | ||||
---|---|---|---|---|---|---|---|---|
Warning C6030 |
Describes C++ Code Analysis warning C6030 and how to resolve it. |
03/10/2023 |
|
|
Use attribute [[noreturn]] over __declspec(noreturn) in function 'function-name'
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.
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.
This check is available in Visual Studio 2022 version 17.0 and later versions.
Code analysis name: USE_ATTRIBUTE_NORETURN
The following code generates C6030:
__declspec(noreturn) void TerminateApplication();
Fix the issue by using the [[noreturn]]
attribute:
[[ noreturn ]] void TerminateApplication();