Wrap #pragma warnings to avoid GCC compilation warnings (#134, #135)

This commit is contained in:
Chuck Walbourn 2021-11-29 13:08:15 -08:00
Родитель 73000ac7d7
Коммит 3734bc95a6
8 изменённых файлов: 67 добавлений и 22 удалений

Просмотреть файл

@ -32,10 +32,12 @@ namespace DirectX
struct BoundingOrientedBox;
struct BoundingFrustum;
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4324 4820)
// C4324: alignment padding warnings
// C4820: Off by default noise
#endif
//-------------------------------------------------------------------------------------
// Bounding sphere
@ -321,7 +323,9 @@ namespace DirectX
// Test a triangle against six planes at once (see BoundingFrustum::GetPlanes)
}
#ifdef _MSC_VER
#pragma warning(pop)
#endif
/****************************************************************************
*
@ -329,12 +333,13 @@ namespace DirectX
*
****************************************************************************/
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4068 4365 4616 6001)
// C4068/4616: ignore unknown pragmas
// C4365: Off by default noise
// C6001: False positives
#endif
#ifdef _PREFAST_
#pragma prefast(push)
#pragma prefast(disable : 25000, "FXMVECTOR is 16 bytes")
@ -346,8 +351,9 @@ namespace DirectX
#ifdef _PREFAST_
#pragma prefast(pop)
#endif
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // namespace DirectX

Просмотреть файл

@ -338,6 +338,7 @@ namespace DirectX
// C4365: Off by default noise
// C4324/4820: padding warnings
#endif
#ifdef _PREFAST_
#pragma prefast(push)
#pragma prefast(disable : 25000, "FXMVECTOR is 16 bytes")
@ -947,11 +948,9 @@ namespace DirectX
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef _PREFAST_
#pragma prefast(pop)
#endif
#ifdef _MSC_VER
#pragma warning(pop)
#endif
@ -2192,11 +2191,9 @@ namespace DirectX
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef _PREFAST_
#pragma prefast(pop)
#endif
#ifdef _MSC_VER
#pragma warning(pop)
#endif

Просмотреть файл

@ -16,13 +16,14 @@ namespace DirectX
namespace PackedVector
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4201 4365 4324 4996)
// C4201: nonstandard extension used
// C4365: Off by default noise
// C4324: alignment padding warnings
// C4996: deprecation warnings
#endif
#ifdef __clang__
#pragma clang diagnostic push
@ -1048,9 +1049,9 @@ namespace DirectX
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef _MSC_VER
#pragma warning(pop)
#endif
/****************************************************************************
*
@ -1107,9 +1108,11 @@ namespace DirectX
XMVECTOR XM_CALLCONV XMLoadUNibble4(_In_ const XMUNIBBLE4* pSource) noexcept;
XMVECTOR XM_CALLCONV XMLoadU555(_In_ const XMU555* pSource) noexcept;
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4996)
// C4996: ignore deprecation warning
#endif
#ifdef __GNUC__
#pragma GCC diagnostic push
@ -1123,8 +1126,9 @@ namespace DirectX
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#ifdef _MSC_VER
#pragma warning(pop)
#endif
/****************************************************************************
*
@ -1164,9 +1168,11 @@ namespace DirectX
void XM_CALLCONV XMStoreUNibble4(_Out_ XMUNIBBLE4* pDestination, _In_ FXMVECTOR V) noexcept;
void XM_CALLCONV XMStoreU555(_Out_ XMU555* pDestination, _In_ FXMVECTOR V) noexcept;
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4996)
// C4996: ignore deprecation warning
#endif
#ifdef __GNUC__
#pragma GCC diagnostic push
@ -1180,21 +1186,23 @@ namespace DirectX
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#ifdef _MSC_VER
#pragma warning(pop)
#endif
/****************************************************************************
*
* Implementation
*
****************************************************************************/
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4068 4214 4204 4365 4616 6001 6101)
// C4068/4616: ignore unknown pragmas
// C4214/4204: nonstandard extension used
// C4365: Off by default noise
// C6001/6101: False positives
#endif
#ifdef _PREFAST_
#pragma prefast(push)
@ -1207,9 +1215,9 @@ namespace DirectX
#ifdef _PREFAST_
#pragma prefast(pop)
#endif
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // namespace PackedVector
} // namespace DirectX

Просмотреть файл

@ -1500,9 +1500,11 @@ inline XMVECTOR XM_CALLCONV XMLoadXDecN4(const XMXDECN4* pSource) noexcept
}
//------------------------------------------------------------------------------
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4996)
// C4996: ignore deprecation warning
#endif
#ifdef __GNUC__
#pragma GCC diagnostic push
@ -1558,8 +1560,9 @@ inline XMVECTOR XM_CALLCONV XMLoadXDec4(const XMXDEC4* pSource) noexcept
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#ifdef _MSC_VER
#pragma warning(pop)
#endif
//------------------------------------------------------------------------------
_Use_decl_annotations_
@ -1696,9 +1699,11 @@ inline XMVECTOR XM_CALLCONV XMLoadUDec4(const XMUDEC4* pSource) noexcept
}
//------------------------------------------------------------------------------
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4996)
// C4996: ignore deprecation warning
#endif
#ifdef __GNUC__
#pragma GCC diagnostic push
@ -1801,8 +1806,9 @@ inline XMVECTOR XM_CALLCONV XMLoadDec4(const XMDEC4* pSource) noexcept
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#ifdef _MSC_VER
#pragma warning(pop)
#endif
//------------------------------------------------------------------------------
_Use_decl_annotations_
@ -2903,9 +2909,11 @@ inline void XM_CALLCONV XMStoreXDecN4
}
//------------------------------------------------------------------------------
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4996)
// C4996: ignore deprecation warning
#endif
#ifdef __GNUC__
#pragma GCC diagnostic push
@ -2982,8 +2990,9 @@ inline void XM_CALLCONV XMStoreXDec4
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#ifdef _MSC_VER
#pragma warning(pop)
#endif
//------------------------------------------------------------------------------
_Use_decl_annotations_
@ -3194,9 +3203,11 @@ inline void XM_CALLCONV XMStoreUDec4
}
//------------------------------------------------------------------------------
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4996)
// C4996: ignore deprecation warning
#endif
#ifdef __GNUC__
#pragma GCC diagnostic push
@ -3327,8 +3338,9 @@ inline void XM_CALLCONV XMStoreDec4
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#ifdef _MSC_VER
#pragma warning(pop)
#endif
//------------------------------------------------------------------------------
_Use_decl_annotations_
@ -4142,10 +4154,11 @@ inline XMXDECN4::XMXDECN4(const float* pArray) noexcept
* XMXDEC4 operators
*
****************************************************************************/
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4996)
// C4996: ignore deprecation warning
#endif
#ifdef __GNUC__
#pragma GCC diagnostic push
@ -4227,8 +4240,9 @@ inline XMDEC4::XMDEC4(const float* pArray) noexcept
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#ifdef _MSC_VER
#pragma warning(pop)
#endif
/****************************************************************************
*

Просмотреть файл

@ -7,9 +7,11 @@
// http://go.microsoft.com/fwlink/p/?LinkId=262885
//-------------------------------------------------------------------------------------
#ifdef _MSC_VER
#pragma warning( disable : 4619 4456 )
// C4619 #pragma warning warnings
// C4456 declaration hides previous local declaration
#endif
#ifdef __clang__
#pragma clang diagnostic ignored "-Wold-style-cast"

Просмотреть файл

@ -7,6 +7,7 @@
// http://go.microsoft.com/fwlink/p/?LinkId=262885
//-------------------------------------------------------------------------------------
#ifdef _MSC_VER
#pragma warning( disable : 4616 4619 4061 4265 4626 5039 )
// C4616/C4619 #pragma warning warnings
// C4061 numerator 'identifier' in switch of enum 'enumeration' is not explicitly handled by a case label
@ -16,8 +17,11 @@
#pragma warning(push)
#pragma warning(disable: 4365)
#endif
#include <d3d11_1.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "DirectXSH.h"
@ -89,8 +93,10 @@ namespace
}\
return false;
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 6101)
#endif
_Success_(return)
bool _LoadScanline(
_Out_writes_(count) DirectX::XMVECTOR* pDestination,
@ -165,8 +171,9 @@ namespace
return false;
}
}
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // namespace anonymous
//-------------------------------------------------------------------------------------

Просмотреть файл

@ -7,12 +7,14 @@
// http://go.microsoft.com/fwlink/p/?LinkId=262885
//-------------------------------------------------------------------------------------
#ifdef _MSC_VER
#pragma warning( disable : 4616 4619 4061 4265 4626 5039 )
// C4616/C4619 #pragma warning warnings
// C4061 numerator 'identifier' in switch of enum 'enumeration' is not explicitly handled by a case label
// C4265 class has virtual functions, but destructor is not virtual
// C4626 assignment operator was implicitly defined as deleted
// C5039 pointer or reference to potentially throwing function passed to extern C function under - EHc
#endif
#include <d3d12.h>
@ -86,8 +88,10 @@ namespace
}\
return false;
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 6101)
#endif
_Success_(return)
bool _LoadScanline(
_Out_writes_(count) DirectX::XMVECTOR* pDestination,
@ -162,8 +166,9 @@ namespace
return false;
}
}
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // namespace anonymous
//-------------------------------------------------------------------------------------

Просмотреть файл

@ -22,8 +22,10 @@
#include <cstdint>
#include <cstring>
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable: 6001 6262)
#endif
namespace XDSP
{
@ -586,7 +588,9 @@ namespace XDSP
// pInputImaginary - [in] input buffer (imaginary components), must have at least uLength/4 elements
// uLength - [in] FFT length in samples, must be a power of 2 >= 4
//----------------------------------------------------------------------------------
#ifdef _MSC_VER
#pragma warning(suppress: 6101)
#endif
inline void FFTPolar(
_Out_writes_(uLength / 4) XMVECTOR* __restrict pOutput,
_In_reads_(uLength / 4) const XMVECTOR* __restrict pInputReal,
@ -862,4 +866,6 @@ namespace XDSP
} // namespace XDSP
#ifdef _MSC_VER
#pragma warning(pop)
#endif