Skip to content

Commit

Permalink
Suppress new clang v16 warnings (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
walbourn authored May 5, 2023
1 parent bec0745 commit f8dccac
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Inc/DirectXCollision.h
Original file line number Diff line number Diff line change
Expand Up @@ -340,14 +340,25 @@ namespace DirectX
// C4365: Off by default noise
// C6001: False positives
#endif

#ifdef _PREFAST_
#pragma prefast(push)
#pragma prefast(disable : 25000, "FXMVECTOR is 16 bytes")
#pragma prefast(disable : 26495, "Union initialization confuses /analyze")
#endif

#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wfloat-equal"
#pragma clang diagnostic ignored "-Wunknown-warning-option"
#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
#endif

#include "DirectXCollision.inl"

#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef _PREFAST_
#pragma prefast(pop)
#endif
Expand Down
5 changes: 5 additions & 0 deletions Inc/DirectXMath.h
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,8 @@ namespace DirectX
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wgnu-anonymous-struct"
#pragma clang diagnostic ignored "-Wnested-anon-types"
#pragma clang diagnostic ignored "-Wunknown-warning-option"
#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
#endif

//------------------------------------------------------------------------------
Expand Down Expand Up @@ -2167,7 +2169,10 @@ namespace DirectX

#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wfloat-equal"
#pragma clang diagnostic ignored "-Wundefined-reinterpret-cast"
#pragma clang diagnostic ignored "-Wunknown-warning-option"
#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
#endif

//------------------------------------------------------------------------------
Expand Down
9 changes: 9 additions & 0 deletions Inc/DirectXPackedVector.h
Original file line number Diff line number Diff line change
Expand Up @@ -1210,8 +1210,17 @@ namespace DirectX
#pragma prefast(disable : 26495, "Union initialization confuses /analyze")
#endif

#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunknown-warning-option"
#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
#endif

#include "DirectXPackedVector.inl"

#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef _PREFAST_
#pragma prefast(pop)
#endif
Expand Down
2 changes: 2 additions & 0 deletions SHMath/DirectXSH.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#pragma clang diagnostic ignored "-Wshadow"
#pragma clang diagnostic ignored "-Wunused-const-variable"
#pragma clang diagnostic ignored "-Wunused-function"
#pragma clang diagnostic ignored "-Wunknown-warning-option"
#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
#endif

#include "DirectXSH.h"
Expand Down
2 changes: 2 additions & 0 deletions SHMath/DirectXSHD3D11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
#ifdef __clang__
#pragma clang diagnostic ignored "-Wcovered-switch-default"
#pragma clang diagnostic ignored "-Wswitch-enum"
#pragma clang diagnostic ignored "-Wunknown-warning-option"
#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
#endif

using namespace DirectX;
Expand Down
2 changes: 2 additions & 0 deletions SHMath/DirectXSHD3D12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
#ifdef __clang__
#pragma clang diagnostic ignored "-Wcovered-switch-default"
#pragma clang diagnostic ignored "-Wswitch-enum"
#pragma clang diagnostic ignored "-Wunknown-warning-option"
#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
#endif

using namespace DirectX;
Expand Down
9 changes: 9 additions & 0 deletions XDSP/XDSP.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
#pragma warning(disable: 6001 6262)
#endif

#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunknown-warning-option"
#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
#endif

namespace XDSP
{
using XMVECTOR = DirectX::XMVECTOR;
Expand Down Expand Up @@ -866,6 +872,9 @@ namespace XDSP

} // namespace XDSP

#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef _MSC_VER
#pragma warning(pop)
#endif

0 comments on commit f8dccac

Please sign in to comment.