[pragma] unify compiler diagnostics

This commit is contained in:
Armin Novak
2023-10-11 17:03:39 +02:00
committed by akallabeth
parent c91a250623
commit 60390ea40c
24 changed files with 153 additions and 210 deletions

View File

@@ -17,13 +17,12 @@
* limitations under the License.
*/
#include <winpr/platform.h>
#include <freerdp/svc.h>
/* The 'entry' function pointers have variable arguments. */
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-prototypes"
#endif
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_STRICT_PROTOTYPES
typedef struct
{
@@ -52,6 +51,4 @@ typedef struct
const STATIC_SUBSYSTEM_ENTRY* table;
} STATIC_ADDIN_TABLE;
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
WINPR_PRAGMA_DIAG_POP

View File

@@ -32,15 +32,9 @@
#include <errno.h>
#include <winpr/thread.h>
#include <winpr/string.h>
#include <winpr/platform.h>
#if __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wparentheses-equality"
#endif /* __clang__ */
#include <gst/gst.h>
#if __clang__
#pragma clang diagnostic pop
#endif /* __clang__ */
#if GST_VERSION_MAJOR > 0
#include <gst/video/videooverlay.h>

View File

@@ -30,15 +30,9 @@
#include <unistd.h>
#include <winpr/string.h>
#include <winpr/platform.h>
#if __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wparentheses-equality"
#endif /* __clang__ */
#include <gst/gst.h>
#if __clang__
#pragma clang diagnostic pop
#endif /* __clang__ */
#include <gst/app/gstappsrc.h>
#include <gst/app/gstappsink.h>

View File

@@ -22,6 +22,7 @@
#include <X11/Xlib.h>
#include <winpr/platform.h>
#include <freerdp/freerdp.h>
#include <freerdp/gdi/gfx.h>
@@ -35,10 +36,8 @@ typedef struct xf_window xfWindow;
#include "xfreerdp.h"
// Extended ICCM flags http://standards.freedesktop.org/wm-spec/wm-spec-latest.html
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_RESERVED_ID_MACRO
#define _NET_WM_MOVERESIZE_SIZE_TOPLEFT 0
#define _NET_WM_MOVERESIZE_SIZE_TOP 1
@@ -57,9 +56,7 @@ typedef struct xf_window xfWindow;
#define _NET_WM_STATE_ADD 1 /* add/set property */
#define _NET_WM_STATE_TOGGLE 2 /* toggle property */
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
WINPR_PRAGMA_DIAG_POP
enum xf_localmove_state
{

View File

@@ -1402,12 +1402,9 @@ BOOL freerdp_client_write_rdp_file(const rdpFile* file, const char* name, BOOL u
return (status == 0) ? TRUE : FALSE;
}
#if __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
#endif
WINPR_ATTR_FORMAT_ARG(3, 4)
static SSIZE_T freerdp_client_write_setting_to_buffer(char** buffer, size_t* bufferSize,
const char* fmt, ...)
WINPR_FORMAT_ARG const char* fmt, ...)
{
va_list ap;
SSIZE_T len;
@@ -1448,9 +1445,6 @@ static SSIZE_T freerdp_client_write_setting_to_buffer(char** buffer, size_t* buf
return len;
}
#if __GNUC__
#pragma GCC diagnostic pop
#endif
size_t freerdp_client_write_rdp_file_buffer(const rdpFile* file, char* buffer, size_t size)
{

View File

@@ -1,18 +1,15 @@
#include <winpr/crt.h>
#include <winpr/print.h>
#include <winpr/platform.h>
#include <freerdp/codec/clear.h>
#if __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-const-variable"
#endif
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_UNUSED_CONST_VAR
/* [MS-RDPEGFX] 4.1.1.1 Example 1 */
static const BYTE PREPARE_CLEAR_EXAMPLE_1[] = "\x03\xc3\x11\x00";
static const BYTE TEST_CLEAR_EXAMPLE_1[] = "\x03\xc3\x11\x00";
#if __GNUC__
#pragma GCC diagnostic pop
#endif
WINPR_PRAGMA_DIAG_POP
/* [MS-RDPEGFX] 4.1.1.1 Example 2 */
static const BYTE TEST_CLEAR_EXAMPLE_2[] =

View File

@@ -2,6 +2,7 @@
#include <winpr/print.h>
#include <winpr/ssl.h>
#include <winpr/wlog.h>
#include <winpr/platform.h>
#include <freerdp/assistance.h>
@@ -21,16 +22,12 @@ static const char TEST_MSRC_INCIDENT_FILE_TYPE1[] =
"L=\"0\" />"
"</UPLOADINFO>";
#if __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-const-variable"
#endif
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_UNUSED_CONST_VAR
static const BYTE TEST_MSRC_INCIDENT_EXPERT_BLOB_TYPE1[32] =
"\x3C\x9C\xAE\x0B\xCE\x7A\xB1\x5C\x8A\xAC\x01\xD6\x76\x04\x5E\xDF"
"\x3F\xFA\xF0\x92\xE2\xDE\x36\x8A\x20\x17\xE6\x8A\x0D\xED\x7C\x90";
#if __GNUC__
#pragma GCC diagnostic pop
#endif
WINPR_PRAGMA_DIAG_POP
static const char TEST_MSRC_INCIDENT_PASSWORD_TYPE2[] = "48BJQ853X3B4";

View File

@@ -20,6 +20,7 @@
#define RDTK_RESOURCES_PRIVATE_H
#include <stdint.h>
#include <winpr/wtypes.h>
#include <rdtk/rdtk.h>
#include "rdtk_engine.h"

View File

@@ -20,6 +20,8 @@
#ifndef WINPR_WTYPES_H
#define WINPR_WTYPES_H
#include <winpr/platform.h>
// C99 related macros
#if defined(__STDC__) && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
#define WINPR_RESTRICT restrict
@@ -101,10 +103,8 @@ typedef LONG_PTR SSIZE_T;
#define VOID void
#endif
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_RESERVED_ID_MACRO
#if !defined(_WIN32) && !defined(__MINGW32__)
@@ -601,8 +601,6 @@ typedef const BYTE* LPCBYTE;
#define _ftelli64(fp) ftello(fp)
#endif
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
WINPR_PRAGMA_DIAG_POP
#endif /* WINPR_WTYPES_H */

View File

@@ -24,6 +24,7 @@
#include <stdlib.h>
#include <string.h>
#include <winpr/platform.h>
#include <winpr/winpr.h>
#include <winpr/spec.h>
@@ -135,19 +136,15 @@ extern "C"
/* Data Alignment */
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_RESERVED_ID_MACRO
#ifndef _ERRNO_T_DEFINED
#define _ERRNO_T_DEFINED
typedef int errno_t;
#endif /* _ERRNO_T_DEFINED */
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
WINPR_PRAGMA_DIAG_POP
#ifndef _WIN32

View File

@@ -20,6 +20,7 @@
#ifndef WINPR_ERROR_H
#define WINPR_ERROR_H
#include <winpr/platform.h>
#include <winpr/winpr.h>
#include <winpr/wtypes.h>
@@ -143,10 +144,8 @@
#define HRESULT_FROM_NT(x) (((x) | FACILITY_NT_BIT))
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_RESERVED_ID_MACRO
#ifdef __cplusplus
#define ERROR_CAST(t, val) static_cast<t>(val)
@@ -161,9 +160,7 @@ static INLINE HRESULT HRESULT_FROM_WIN32(unsigned long x)
return ERROR_CAST(HRESULT, (((x)&0x0000FFFF) | (FACILITY_WIN32 << 16) | 0x80000000));
}
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
WINPR_PRAGMA_DIAG_POP
#define HRESULT_SEVERITY(hr) (((hr) >> 31) & 0x1)

View File

@@ -21,6 +21,7 @@
#define WINPR_INTERLOCKED_H
#include <winpr/spec.h>
#include <winpr/platform.h>
#include <winpr/winpr.h>
#include <winpr/wtypes.h>
#include <winpr/platform.h>
@@ -78,18 +79,14 @@ extern "C"
#else /* _WIN64 */
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_RESERVED_ID_MACRO
#define WINPR_SLIST_ENTRY WINPR_SINGLE_LIST_ENTRY
#define _WINPR_SLIST_ENTRY _WINPR_SINGLE_LIST_ENTRY
#define WINPR_PSLIST_ENTRY WINPR_PSINGLE_LIST_ENTRY
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
WINPR_PRAGMA_DIAG_POP
#endif /* _WIN64 */

View File

@@ -22,13 +22,52 @@
#include <stdlib.h>
#include <winpr/wtypes.h>
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wreserved-id-macro"
#if __clang__
#define WINPR_PRAGMA_DIAG_PUSH _Pragma("clang diagnostic push")
#define WINPR_PRAGMA_DIAG_IGNORED_MISSING_PROTOTYPES \
_Pragma("clang diagnostic ignored \"-Wmissing-prototypes\"")
#define WINPR_PRAGMA_DIAG_IGNORED_STRICT_PROTOTYPES \
_Pragma("clang diagnostic ignored \"-Wstrict-prototypes\"")
#define WINPR_PRAGMA_DIAG_IGNORED_RESERVED_ID_MACRO \
_Pragma("clang diagnostic ignored \"-Wreserved-id-macro\"")
#define WINPR_PRAGMA_DIAG_IGNORED_ATOMIC_SEQ_CST \
_Pragma("clang diagnostic ignored \"-Watomic-implicit-seq-cst\"")
#define WINPR_PRAGMA_DIAG_IGNORED_UNUSED_CONST_VAR \
_Pragma("clang diagnostic ignored \"-Wunused-const-variable\"")
#define WINPR_PRAGMA_DIAG_IGNORED_FORMAT_SECURITY \
_Pragma("clang diagnostic ignored \"-Wformat-security\"")
#define WINPR_PRAGMA_DIAG_POP _Pragma("clang diagnostic pop")
#elif __GNUC__
#define WINPR_PRAGMA_DIAG_PUSH _Pragma("GCC diagnostic push")
#define WINPR_PRAGMA_DIAG_IGNORED_MISSING_PROTOTYPES \
_Pragma("GCC diagnostic ignored \"-Wmissing-prototypes\"")
#define WINPR_PRAGMA_DIAG_IGNORED_STRICT_PROTOTYPES \
_Pragma("GCC diagnostic ignored \"-Wstrict-prototypes\"")
#define WINPR_PRAGMA_DIAG_IGNORED_RESERVED_ID_MACRO /* not supported _Pragma("GCC diagnostic \
ignored \"-Wreserved-id-macro\"") */
#define WINPR_PRAGMA_DIAG_IGNORED_ATOMIC_SEQ_CST /* not supported _Pragma("GCC diagnostic \
ignored \
\"-Watomic-implicit-seq-cst\"") */
#define WINPR_PRAGMA_DIAG_IGNORED_UNUSED_CONST_VAR \
_Pragma("GCC diagnostic ignored \"-Wunused-const-variable\"")
#define WINPR_PRAGMA_DIAG_IGNORED_FORMAT_SECURITY \
_Pragma("GCC diagnostic ignored \"-Wformat-security\"")
#define WINPR_PRAGMA_DIAG_POP _Pragma("GCC diagnostic pop")
#else
#define WINPR_PRAGMA_DIAG_PUSH
#define WINPR_PRAGMA_DIAG_IGNORED_MISSING_PROTOTYPES
#define WINPR_PRAGMA_DIAG_IGNORED_STRICT_PROTOTYPES
#define WINPR_PRAGMA_DIAG_IGNORED_RESERVED_ID_MACRO
#define WINPR_PRAGMA_DIAG_IGNORED_ATOMIC_SEQ_CST
#define WINPR_PRAGMA_DIAG_IGNORED_UNUSED_CONST_VAR
#define WINPR_PRAGMA_DIAG_IGNORED_FORMAT_SECURITY
#define WINPR_PRAGMA_DIAG_POP
#endif
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_RESERVED_ID_MACRO
/*
* Processor Architectures:
* http://sourceforge.net/p/predef/wiki/Architectures/
@@ -292,8 +331,6 @@
#endif /* __BYTE_ORDER */
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
WINPR_PRAGMA_DIAG_POP
#endif /* WINPR_PLATFORM_H */

View File

@@ -22,24 +22,21 @@
#ifndef WINPR_SMARTCARD_H
#define WINPR_SMARTCARD_H
#include <winpr/platform.h>
#include <winpr/winpr.h>
#include <winpr/wtypes.h>
#include <winpr/io.h>
#include <winpr/error.h>
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_RESERVED_ID_MACRO
#ifndef _WINSCARD_H_
#define _WINSCARD_H_ /* do not include winscard.h */
#endif
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
WINPR_PRAGMA_DIAG_POP
#ifndef SCARD_S_SUCCESS

View File

@@ -31,10 +31,8 @@
#else
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_RESERVED_ID_MACRO
#define DUMMYUNIONNAME u
#define DUMMYUNIONNAME1 u1
@@ -960,7 +958,7 @@ extern "C++"
((type*)((PCHAR)(address) - (ULONG_PTR)(&((type*)0)->field)))
#if defined(__clang__)
#pragma clang diagnostic pop
WINPR_PRAGMA_DIAG_POP
#endif
#endif

View File

@@ -20,6 +20,7 @@
#ifndef WINPR_SSPI_H
#define WINPR_SSPI_H
#include <winpr/platform.h>
#include <winpr/winpr.h>
#include <winpr/wtypes.h>
#include <winpr/windows.h>
@@ -54,19 +55,15 @@ typedef struct
typedef SECURITY_INTEGER TimeStamp;
typedef SECURITY_INTEGER* PTimeStamp;
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_RESERVED_ID_MACRO
#ifndef __SECSTATUS_DEFINED__
typedef LONG SECURITY_STATUS;
#define __SECSTATUS_DEFINED__
#endif /* __SECSTATUS_DEFINED__ */
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
WINPR_PRAGMA_DIAG_POP
typedef struct
{
@@ -669,10 +666,8 @@ typedef struct
#if !defined(_WIN32) || defined(_UWP) || defined(__MINGW32__)
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_RESERVED_ID_MACRO
#ifndef _AUTH_IDENTITY_DEFINED
#define _AUTH_IDENTITY_DEFINED
@@ -812,9 +807,7 @@ typedef union _SEC_WINNT_AUTH_IDENTITY_INFO
#endif /* _AUTH_IDENTITY_INFO_DEFINED */
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
WINPR_PRAGMA_DIAG_POP
#if !defined(__MINGW32__)
typedef struct

View File

@@ -26,6 +26,7 @@
#include <stdlib.h>
#include <string.h>
#include <winpr/platform.h>
#include <winpr/winpr.h>
#include <winpr/wtypes.h>
#include <winpr/error.h>
@@ -299,17 +300,13 @@ extern "C"
InitializeCriticalSectionAndSpinCount(lpCriticalSection, dwSpinCount)
#endif
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_RESERVED_ID_MACRO
#ifndef _RTL_RUN_ONCE_DEF
#define _RTL_RUN_ONCE_DEF
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
WINPR_PRAGMA_DIAG_POP
#define RTL_RUN_ONCE_INIT \
{ \

View File

@@ -20,6 +20,7 @@
#ifndef WINPR_WINSOCK_H
#define WINPR_WINSOCK_H
#include <winpr/platform.h>
#include <winpr/winpr.h>
#include <winpr/wtypes.h>
#include <winpr/windows.h>
@@ -185,10 +186,8 @@ typedef union sockaddr_gen
struct sockaddr_in6_old AddressIn6;
} sockaddr_gen;
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_RESERVED_ID_MACRO
#define _IFF_UP 0x00000001
#define _IFF_BROADCAST 0x00000002
@@ -196,9 +195,7 @@ typedef union sockaddr_gen
#define _IFF_POINTTOPOINT 0x00000008
#define _IFF_MULTICAST 0x00000010
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
WINPR_PRAGMA_DIAG_POP
typedef struct
{

View File

@@ -18,17 +18,14 @@
*/
#include <winpr/config.h>
#include <winpr/platform.h>
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_RESERVED_ID_MACRO
#define _FILE_OFFSET_BITS 64
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
WINPR_PRAGMA_DIAG_POP
#include <errno.h>

View File

@@ -19,6 +19,7 @@
#include <winpr/config.h>
#include <winpr/platform.h>
#include <winpr/synch.h>
#include <winpr/handle.h>
@@ -221,14 +222,10 @@ USHORT QueryDepthSList(WINPR_PSLIST_HEADER ListHead)
LONG InterlockedIncrement(LONG volatile* Addend)
{
#if defined(__GNUC__) || defined(__clang__)
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Watomic-implicit-seq-cst"
#endif
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_ATOMIC_SEQ_CST
return __sync_add_and_fetch(Addend, 1);
#ifdef __clang__
#pragma clang diagnostic pop
#endif
WINPR_PRAGMA_DIAG_POP
#else
return 0;
#endif
@@ -237,14 +234,10 @@ LONG InterlockedIncrement(LONG volatile* Addend)
LONG InterlockedDecrement(LONG volatile* Addend)
{
#if defined(__GNUC__) || defined(__clang__)
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Watomic-implicit-seq-cst"
#endif
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_ATOMIC_SEQ_CST
return __sync_sub_and_fetch(Addend, 1);
#ifdef __clang__
#pragma clang diagnostic pop
#endif
WINPR_PRAGMA_DIAG_POP
#else
return 0;
#endif
@@ -253,14 +246,10 @@ LONG InterlockedDecrement(LONG volatile* Addend)
LONG InterlockedExchange(LONG volatile* Target, LONG Value)
{
#if defined(__GNUC__) || defined(__clang__)
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Watomic-implicit-seq-cst"
#endif
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_ATOMIC_SEQ_CST
return __sync_val_compare_and_swap(Target, *Target, Value);
#ifdef __clang__
#pragma clang diagnostic pop
#endif
WINPR_PRAGMA_DIAG_POP
#else
return 0;
#endif
@@ -269,14 +258,10 @@ LONG InterlockedExchange(LONG volatile* Target, LONG Value)
LONG InterlockedExchangeAdd(LONG volatile* Addend, LONG Value)
{
#if defined(__GNUC__) || defined(__clang__)
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Watomic-implicit-seq-cst"
#endif
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_ATOMIC_SEQ_CST
return __sync_fetch_and_add(Addend, Value);
#ifdef __clang__
#pragma clang diagnostic pop
#endif
WINPR_PRAGMA_DIAG_POP
#else
return 0;
#endif
@@ -285,14 +270,10 @@ LONG InterlockedExchangeAdd(LONG volatile* Addend, LONG Value)
LONG InterlockedCompareExchange(LONG volatile* Destination, LONG Exchange, LONG Comperand)
{
#if defined(__GNUC__) || defined(__clang__)
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Watomic-implicit-seq-cst"
#endif
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_ATOMIC_SEQ_CST
return __sync_val_compare_and_swap(Destination, Comperand, Exchange);
#ifdef __clang__
#pragma clang diagnostic pop
#endif
WINPR_PRAGMA_DIAG_POP
#else
return 0;
#endif
@@ -302,14 +283,10 @@ PVOID InterlockedCompareExchangePointer(PVOID volatile* Destination, PVOID Excha
PVOID Comperand)
{
#if defined(__GNUC__) || defined(__clang__)
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Watomic-implicit-seq-cst"
#endif
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_ATOMIC_SEQ_CST
return __sync_val_compare_and_swap(Destination, Comperand, Exchange);
#ifdef __clang__
#pragma clang diagnostic pop
#endif
WINPR_PRAGMA_DIAG_POP
#else
return 0;
#endif
@@ -390,14 +367,10 @@ LONGLONG InterlockedCompareExchange64(LONGLONG volatile* Destination, LONGLONG E
LONGLONG Comperand)
{
#if defined(__GNUC__) || defined(__clang__)
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Watomic-implicit-seq-cst"
#endif
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_ATOMIC_SEQ_CST
return __sync_val_compare_and_swap(Destination, Comperand, Exchange);
#ifdef __clang__
#pragma clang diagnostic pop
#endif
WINPR_PRAGMA_DIAG_POP
#else
return 0;
#endif

View File

@@ -17,18 +17,15 @@
* limitations under the License.
*/
#include <winpr/platform.h>
#include <winpr/config.h>
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_RESERVED_ID_MACRO
#define _NO_KSECDD_IMPORT_ 1
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
WINPR_PRAGMA_DIAG_POP
#include <winpr/sspi.h>
@@ -40,10 +37,8 @@
#include "sspi.h"
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmissing-prototypes"
#endif
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_MISSING_PROTOTYPES
static wLog* g_Log = NULL;
@@ -1112,9 +1107,7 @@ SECURITY_STATUS SEC_ENTRY sspi_VerifySignature(PCtxtHandle phContext, PSecBuffer
return status;
}
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
WINPR_PRAGMA_DIAG_POP
void sspi_FreeAuthIdentity(SEC_WINNT_AUTH_IDENTITY* identity)
{

View File

@@ -17,6 +17,8 @@
* limitations under the License.
*/
#include <winpr/platform.h>
#include <winpr/wtypes.h>
#include <winpr/config.h>
#ifdef _WIN32
@@ -34,10 +36,8 @@ typedef unsigned long ULONG;
#endif
typedef LONG SECURITY_STATUS;
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmissing-prototypes"
#endif
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_MISSING_PROTOTYPES
#ifdef SSPI_DLL
@@ -342,6 +342,4 @@ SSPI_EXPORT SECURITY_STATUS SEC_ENTRY VerifySignature(void* phContext, void* pMe
#endif /* SSPI_DLL */
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
WINPR_PRAGMA_DIAG_POP

View File

@@ -19,6 +19,7 @@
#include <winpr/config.h>
#include <winpr/platform.h>
#include <winpr/windows.h>
#include <winpr/synch.h>
@@ -34,10 +35,8 @@
#include <time.h>
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_RESERVED_ID_MACRO
#ifdef WINPR_HAVE_UNISTD_H
#ifndef _XOPEN_SOURCE
@@ -46,9 +45,7 @@
#include <unistd.h>
#endif
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
WINPR_PRAGMA_DIAG_POP
VOID Sleep(DWORD dwMilliseconds)
{

View File

@@ -289,8 +289,14 @@ BOOL WLog_Layout_GetMessagePrefix(wLog* log, wLogLayout* layout, wLogMessage* me
if (!replace_format_string(layout->FormatString, &recurse, format, ARRAYSIZE(format)))
return FALSE;
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_FORMAT_SECURITY
WLog_PrintMessagePrefix(log, message, format);
WINPR_PRAGMA_DIAG_POP
return TRUE;
}