diff --git a/reactos/include/crt/mingw32/intrin.h b/reactos/include/crt/mingw32/intrin.h index 2d258c0586d..7e0b1d73ff4 100644 --- a/reactos/include/crt/mingw32/intrin.h +++ b/reactos/include/crt/mingw32/intrin.h @@ -30,6 +30,7 @@ #ifndef RC_INVOKED +#define _PRAGMA_WARNING_SUPPRESS(x) /* Only for MSVC */ #define __INTRIN_INLINE extern __inline__ __attribute__((__always_inline__,__gnu_inline__)) #ifndef _SIZE_T_DEFINED diff --git a/reactos/include/crt/msc/intrin.h b/reactos/include/crt/msc/intrin.h index 6875399828e..1aa63e22b30 100644 --- a/reactos/include/crt/msc/intrin.h +++ b/reactos/include/crt/msc/intrin.h @@ -5,6 +5,9 @@ extern "C" { #endif +/** Pragma support **/ +#define _PRAGMA_WARNING_SUPPRESS(x) __pragma(warning(suppress: x)) + /*** Stack frame juggling ***/ void * _ReturnAddress(void); #pragma intrinsic(_ReturnAddress) diff --git a/reactos/include/ndk/rtlfuncs.h b/reactos/include/ndk/rtlfuncs.h index 6c79305f59b..0e3665c9369 100644 --- a/reactos/include/ndk/rtlfuncs.h +++ b/reactos/include/ndk/rtlfuncs.h @@ -593,6 +593,7 @@ RtlAddVectoredExceptionHandler( IN PVECTORED_EXCEPTION_HANDLER VectoredHandler ); +__analysis_noreturn NTSYSAPI VOID NTAPI diff --git a/reactos/include/psdk/specstrings.h b/reactos/include/psdk/specstrings.h index 294a8afa3fe..afeb7930dfa 100644 --- a/reactos/include/psdk/specstrings.h +++ b/reactos/include/psdk/specstrings.h @@ -46,16 +46,17 @@ #define __in_awcount(expr,size) #define __nullnullterminated #define __in_data_source(src_sym) -#define __analysis_noreturn #define __kernel_entry #if (_MSC_VER >= 1000) && !defined(__midl) && defined(_PREFAST_) #define __inner_data_source(src_raw) _SA_annotes1(SAL_untrusted_data_source,src_raw) #define __out_data_source(src_sym) _Post_ __inner_data_source(#src_sym) +#define __analysis_noreturn __declspec(noreturn) #else #define __out_data_source(src_sym) +#define __analysis_noreturn #endif diff --git a/reactos/include/reactos/debug.h b/reactos/include/reactos/debug.h index 3c741b36d50..18b14efd6b3 100644 --- a/reactos/include/reactos/debug.h +++ b/reactos/include/reactos/debug.h @@ -27,20 +27,21 @@ ULONG __cdecl DbgPrint( - IN PCCH Format, - IN ... + _In_z_ _Printf_format_string_ PCSTR Format, + ... ); NTSYSAPI ULONG __cdecl DbgPrintEx( - IN ULONG ComponentId, - IN ULONG Level, - IN PCCH Format, - IN ... + _In_ ULONG ComponentId, + _In_ ULONG Level, + _In_z_ _Printf_format_string_ PCCH Format, + ... ); +__analysis_noreturn NTSYSAPI VOID NTAPI @@ -107,7 +108,7 @@ RtlAssert( #define WARN_(ch, fmt, ...) DbgPrintEx(DPFLTR_##ch##_ID, DPFLTR_WARNING_LEVEL, "(%s:%d) " fmt, __FILE__, __LINE__, ##__VA_ARGS__) #define TRACE_(ch, fmt, ...) DbgPrintEx(DPFLTR_##ch##_ID, DPFLTR_TRACE_LEVEL, "(%s:%d) " fmt, __FILE__, __LINE__, ##__VA_ARGS__) #define INFO_(ch, fmt, ...) DbgPrintEx(DPFLTR_##ch##_ID, DPFLTR_INFO_LEVEL, "(%s:%d) " fmt, __FILE__, __LINE__, ##__VA_ARGS__) - + #define ERR__(ch, fmt, ...) DbgPrintEx(ch, DPFLTR_ERROR_LEVEL, "(%s:%d) " fmt, __FILE__, __LINE__, ##__VA_ARGS__) #define WARN__(ch, fmt, ...) DbgPrintEx(ch, DPFLTR_WARNING_LEVEL, "(%s:%d) " fmt, __FILE__, __LINE__, ##__VA_ARGS__) #define TRACE__(ch, fmt, ...) DbgPrintEx(ch, DPFLTR_TRACE_LEVEL, "(%s:%d) " fmt, __FILE__, __LINE__, ##__VA_ARGS__) @@ -124,7 +125,7 @@ RtlAssert( #define WARN_(ch, ...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0) #define TRACE_(ch, ...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0) #define INFO_(ch, ...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0) - + #define ERR__(ch, ...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0) #define WARN__(ch, ...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0) #define TRACE__(ch, ...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0) diff --git a/reactos/include/reactos/probe.h b/reactos/include/reactos/probe.h index 2f4e62ee3aa..5e605f652ad 100644 --- a/reactos/include/reactos/probe.h +++ b/reactos/include/reactos/probe.h @@ -109,9 +109,8 @@ ProbeArrayForRead(IN const VOID *ArrayPtr, } /* Probe the array */ - ProbeForRead(ArrayPtr, - ArraySize, - Alignment); + _PRAGMA_WARNING_SUPPRESS(28125) /* Must be inside __try / __except block */ + ProbeForRead(ArrayPtr, ArraySize, Alignment); } static __inline @@ -131,9 +130,8 @@ ProbeArrayForWrite(IN OUT PVOID ArrayPtr, } /* Probe the array */ - ProbeForWrite(ArrayPtr, - ArraySize, - Alignment); + _PRAGMA_WARNING_SUPPRESS(28125) /* Must be inside __try / __except block */ + ProbeForWrite(ArrayPtr, ArraySize, Alignment); } #endif /* _WIN32K_ */