Skip to content

Commit eb9eb35

Browse files
authored
Suppress warning C26814; Minor renaming and tidy-up. (#468)
1 parent 4c40705 commit eb9eb35

File tree

4 files changed

+121
-122
lines changed

4 files changed

+121
-122
lines changed

include/wil/common.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,14 @@
6969

7070
/// @cond
7171
#if defined(_MSVC_LANG)
72-
#define __WI_SUPPRESS_4127_S \
73-
__pragma(warning(push)) __pragma(warning(disable : 4127)) __pragma(warning(disable : 26498)) __pragma(warning(disable : 4245))
74-
#define __WI_SUPPRESS_4127_E __pragma(warning(pop))
75-
#define __WI_SUPPRESS_NULLPTR_ANALYSIS __pragma(warning(suppress : 28285)) __pragma(warning(suppress : 6504))
72+
#define __WI_SUPPRESS_BREAKING_WARNINGS_S __pragma(warning(push)) __pragma(warning(disable : 4127 26498 4245 26814))
73+
#define __WI_SUPPRESS_BREAKING_WARNINGS_E __pragma(warning(pop))
74+
#define __WI_SUPPRESS_NULLPTR_ANALYSIS __pragma(warning(suppress : 28285 6504))
7675
#define __WI_SUPPRESS_NONINIT_ANALYSIS __pragma(warning(suppress : 26495))
7776
#define __WI_SUPPRESS_NOEXCEPT_ANALYSIS __pragma(warning(suppress : 26439))
7877
#else
79-
#define __WI_SUPPRESS_4127_S
80-
#define __WI_SUPPRESS_4127_E
78+
#define __WI_SUPPRESS_BREAKING_WARNINGS_S
79+
#define __WI_SUPPRESS_BREAKING_WARNINGS_E
8180
#define __WI_SUPPRESS_NULLPTR_ANALYSIS
8281
#define __WI_SUPPRESS_NONINIT_ANALYSIS
8382
#define __WI_SUPPRESS_NOEXCEPT_ANALYSIS

include/wil/nt_result_macros.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
// Helpers for return macros
2020
/// @cond
2121
#define __NT_RETURN_NTSTATUS(status, str) \
22-
__WI_SUPPRESS_4127_S do \
22+
__WI_SUPPRESS_BREAKING_WARNINGS_S do \
2323
{ \
2424
NTSTATUS __status = (status); \
2525
if (FAILED_NTSTATUS(__status)) \
@@ -28,9 +28,9 @@
2828
} \
2929
return __status; \
3030
} \
31-
__WI_SUPPRESS_4127_E while ((void)0, 0)
31+
__WI_SUPPRESS_BREAKING_WARNINGS_E while ((void)0, 0)
3232
#define __NT_RETURN_NTSTATUS_MSG(status, str, fmt, ...) \
33-
__WI_SUPPRESS_4127_S do \
33+
__WI_SUPPRESS_BREAKING_WARNINGS_S do \
3434
{ \
3535
NTSTATUS __status = (status); \
3636
if (FAILED_NTSTATUS(__status)) \
@@ -39,7 +39,7 @@
3939
} \
4040
return __status; \
4141
} \
42-
__WI_SUPPRESS_4127_E while ((void)0, 0)
42+
__WI_SUPPRESS_BREAKING_WARNINGS_E while ((void)0, 0)
4343
/// @endcond
4444

4545
//*****************************************************************************
@@ -55,27 +55,27 @@
5555

5656
// Conditionally returns failures (NTSTATUS) - always logs failures
5757
#define NT_RETURN_IF_NTSTATUS_FAILED(status) \
58-
__WI_SUPPRESS_4127_S do \
58+
__WI_SUPPRESS_BREAKING_WARNINGS_S do \
5959
{ \
6060
const auto __statusRet = wil::verify_ntstatus(status); \
6161
if (FAILED_NTSTATUS(__statusRet)) \
6262
{ \
6363
__NT_RETURN_NTSTATUS(__statusRet, #status); \
6464
} \
6565
} \
66-
__WI_SUPPRESS_4127_E while ((void)0, 0)
66+
__WI_SUPPRESS_BREAKING_WARNINGS_E while ((void)0, 0)
6767

6868
// Conditionally returns failures (NTSTATUS) - always logs a var-arg message on failure
6969
#define NT_RETURN_IF_NTSTATUS_FAILED_MSG(status, fmt, ...) \
70-
__WI_SUPPRESS_4127_S do \
70+
__WI_SUPPRESS_BREAKING_WARNINGS_S do \
7171
{ \
7272
const auto __statusRet = wil::verify_ntstatus(status); \
7373
if (FAILED_NTSTATUS(__statusRet)) \
7474
{ \
7575
__NT_RETURN_NTSTATUS_MSG(__statusRet, #status, fmt, ##__VA_ARGS__); \
7676
} \
7777
} \
78-
__WI_SUPPRESS_4127_E while ((void)0, 0)
78+
__WI_SUPPRESS_BREAKING_WARNINGS_E while ((void)0, 0)
7979

8080
//*****************************************************************************
8181
// Macros to catch and convert exceptions on failure

0 commit comments

Comments
 (0)