mirror of
https://github.com/reactos/reactos.git
synced 2024-08-12 14:16:30 +00:00
[PSDK/DDK/XDK]
- Make NT_ASSERT() give the MSVC static analyzer a hint that the condition can now be excpected to be true. This adds __analysis_unreachable(), which uses __assume(0) on _PREFAST_ builds. This is neccessary, since it seems impossible to make MSVC respect __analysis_noreturn / __declspec(noreturn) on an intrinsic prototype like __int2c(). svn path=/trunk/; revision=66642
This commit is contained in:
parent
a3df492617
commit
83779b37e6
|
@ -11189,6 +11189,12 @@ RtlCheckBit(
|
||||||
DbgPrint("Assertion failed at %s(%d): %S\n", __FILE__, __LINE__, msg)
|
DbgPrint("Assertion failed at %s(%d): %S\n", __FILE__, __LINE__, msg)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef _PREFAST_
|
||||||
|
#define __analysis_unreachable() __assume(0)
|
||||||
|
#else
|
||||||
|
#define __analysis_unreachable() ((void)0)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define NT_VERIFY(exp) \
|
#define NT_VERIFY(exp) \
|
||||||
((!(exp)) ? \
|
((!(exp)) ? \
|
||||||
(__assert_annotationA(#exp), \
|
(__assert_annotationA(#exp), \
|
||||||
|
@ -11208,17 +11214,17 @@ RtlCheckBit(
|
||||||
#define NT_ASSERT(exp) \
|
#define NT_ASSERT(exp) \
|
||||||
((VOID)((!(exp)) ? \
|
((VOID)((!(exp)) ? \
|
||||||
(__assert_annotationA(#exp), \
|
(__assert_annotationA(#exp), \
|
||||||
DbgRaiseAssertionFailure(), FALSE) : TRUE))
|
DbgRaiseAssertionFailure(), __analysis_unreachable(), FALSE) : TRUE))
|
||||||
|
|
||||||
#define NT_ASSERTMSG(msg, exp) \
|
#define NT_ASSERTMSG(msg, exp) \
|
||||||
((VOID)((!(exp)) ? \
|
((VOID)((!(exp)) ? \
|
||||||
(__assert_annotationA(msg), \
|
(__assert_annotationA(msg), \
|
||||||
DbgRaiseAssertionFailure(), FALSE) : TRUE))
|
DbgRaiseAssertionFailure(), __analysis_unreachable(), FALSE) : TRUE))
|
||||||
|
|
||||||
#define NT_ASSERTMSGW(msg, exp) \
|
#define NT_ASSERTMSGW(msg, exp) \
|
||||||
((VOID)((!(exp)) ? \
|
((VOID)((!(exp)) ? \
|
||||||
(__assert_annotationW(msg), \
|
(__assert_annotationW(msg), \
|
||||||
DbgRaiseAssertionFailure(), FALSE) : TRUE))
|
DbgRaiseAssertionFailure(), __analysis_unreachable(), FALSE) : TRUE))
|
||||||
|
|
||||||
#else /* !DBG */
|
#else /* !DBG */
|
||||||
|
|
||||||
|
|
|
@ -3241,6 +3241,12 @@ RtlCheckBit(
|
||||||
DbgPrint("Assertion failed at %s(%d): %S\n", __FILE__, __LINE__, msg)
|
DbgPrint("Assertion failed at %s(%d): %S\n", __FILE__, __LINE__, msg)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef _PREFAST_
|
||||||
|
#define __analysis_unreachable() __assume(0)
|
||||||
|
#else
|
||||||
|
#define __analysis_unreachable() ((void)0)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define NT_VERIFY(exp) \
|
#define NT_VERIFY(exp) \
|
||||||
((!(exp)) ? \
|
((!(exp)) ? \
|
||||||
(__assert_annotationA(#exp), \
|
(__assert_annotationA(#exp), \
|
||||||
|
@ -3260,17 +3266,17 @@ RtlCheckBit(
|
||||||
#define NT_ASSERT(exp) \
|
#define NT_ASSERT(exp) \
|
||||||
((VOID)((!(exp)) ? \
|
((VOID)((!(exp)) ? \
|
||||||
(__assert_annotationA(#exp), \
|
(__assert_annotationA(#exp), \
|
||||||
DbgRaiseAssertionFailure(), FALSE) : TRUE))
|
DbgRaiseAssertionFailure(), __analysis_unreachable(), FALSE) : TRUE))
|
||||||
|
|
||||||
#define NT_ASSERTMSG(msg, exp) \
|
#define NT_ASSERTMSG(msg, exp) \
|
||||||
((VOID)((!(exp)) ? \
|
((VOID)((!(exp)) ? \
|
||||||
(__assert_annotationA(msg), \
|
(__assert_annotationA(msg), \
|
||||||
DbgRaiseAssertionFailure(), FALSE) : TRUE))
|
DbgRaiseAssertionFailure(), __analysis_unreachable(), FALSE) : TRUE))
|
||||||
|
|
||||||
#define NT_ASSERTMSGW(msg, exp) \
|
#define NT_ASSERTMSGW(msg, exp) \
|
||||||
((VOID)((!(exp)) ? \
|
((VOID)((!(exp)) ? \
|
||||||
(__assert_annotationW(msg), \
|
(__assert_annotationW(msg), \
|
||||||
DbgRaiseAssertionFailure(), FALSE) : TRUE))
|
DbgRaiseAssertionFailure(), __analysis_unreachable(), FALSE) : TRUE))
|
||||||
|
|
||||||
#else /* !DBG */
|
#else /* !DBG */
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue