Author: tkreuzer
Date: Sun Jul 29 17:25:05 2012
New Revision: 56983
URL:
http://svn.reactos.org/svn/reactos?rev=56983&view=rev
Log:
[INCLUDES]
- Add _PRAGMA_WARNING_SUPPRESS() macro
- Fix definition of __analysis_noreturn for PREFAST runs
- Annotate RtlAssert with __analysis_noreturn everywhere
- Add proper annotations to all DbgPrint and DbgPrintEx definitions
- Suppress warnings for use of ProbeForRead outside of SEH
Modified:
trunk/reactos/include/crt/mingw32/intrin.h
trunk/reactos/include/crt/msc/intrin.h
trunk/reactos/include/ndk/rtlfuncs.h
trunk/reactos/include/psdk/specstrings.h
trunk/reactos/include/reactos/debug.h
trunk/reactos/include/reactos/probe.h
Modified: trunk/reactos/include/crt/mingw32/intrin.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/mingw32/intrin…
==============================================================================
--- trunk/reactos/include/crt/mingw32/intrin.h [iso-8859-1] (original)
+++ trunk/reactos/include/crt/mingw32/intrin.h [iso-8859-1] Sun Jul 29 17:25:05 2012
@@ -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
Modified: trunk/reactos/include/crt/msc/intrin.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/msc/intrin.h?r…
==============================================================================
--- trunk/reactos/include/crt/msc/intrin.h [iso-8859-1] (original)
+++ trunk/reactos/include/crt/msc/intrin.h [iso-8859-1] Sun Jul 29 17:25:05 2012
@@ -4,6 +4,9 @@
#ifdef __cplusplus
extern "C" {
#endif
+
+/** Pragma support **/
+#define _PRAGMA_WARNING_SUPPRESS(x) __pragma(warning(suppress: x))
/*** Stack frame juggling ***/
void * _ReturnAddress(void);
Modified: trunk/reactos/include/ndk/rtlfuncs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/rtlfuncs.h?rev…
==============================================================================
--- trunk/reactos/include/ndk/rtlfuncs.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/rtlfuncs.h [iso-8859-1] Sun Jul 29 17:25:05 2012
@@ -593,6 +593,7 @@
IN PVECTORED_EXCEPTION_HANDLER VectoredHandler
);
+__analysis_noreturn
NTSYSAPI
VOID
NTAPI
Modified: trunk/reactos/include/psdk/specstrings.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/specstrings.h…
==============================================================================
--- trunk/reactos/include/psdk/specstrings.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/specstrings.h [iso-8859-1] Sun Jul 29 17:25:05 2012
@@ -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
Modified: trunk/reactos/include/reactos/debug.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/debug.h?re…
==============================================================================
--- trunk/reactos/include/reactos/debug.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/debug.h [iso-8859-1] Sun Jul 29 17:25:05 2012
@@ -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 @@
#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 @@
#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)
Modified: trunk/reactos/include/reactos/probe.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/probe.h?re…
==============================================================================
--- trunk/reactos/include/reactos/probe.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/probe.h [iso-8859-1] Sun Jul 29 17:25:05 2012
@@ -109,9 +109,8 @@
}
/* 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 @@
}
/* Probe the array */
- ProbeForWrite(ArrayPtr,
- ArraySize,
- Alignment);
+ _PRAGMA_WARNING_SUPPRESS(28125) /* Must be inside __try / __except block */
+ ProbeForWrite(ArrayPtr, ArraySize, Alignment);
}
#endif /* _WIN32K_ */