Skip to content

Commit b942dad

Browse files
authored
address compiler warnings (#861)
* Fixes unknown-pragma warnings for non-MSC compilers in `LocklessQueue.h`. * Suppress 64-to-32-bit shortening compiler warning for newer versions of MSC (warning 4244) in `websocketpp_websocket.cpp`.
1 parent 3416210 commit b942dad

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Diff for: Source/Task/LocklessQueue.h

+4
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@
5656
******************************************************************************/
5757

5858
// LocklessQueue needs certain alignment. Disable alignment warning.
59+
#if _WIN32
5960
#pragma warning(push)
6061
#pragma warning(disable: 4324)
62+
#endif
6163

6264
template <typename TData>
6365
class alignas(8) LocklessQueue
@@ -868,4 +870,6 @@ class alignas(8) LocklessQueue
868870
}
869871
};
870872

873+
#if _WIN32
871874
#pragma warning(pop)
875+
#endif

Diff for: Source/WebSocket/Websocketpp/websocketpp_websocket.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
#ifdef _WIN32
2020
#pragma warning( push )
21-
#pragma warning( disable : 4100 4127 4512 4996 4701 4267 )
21+
#pragma warning( disable : 4100 4127 4512 4996 4701 4267 4244 )
2222
#define _WEBSOCKETPP_CPP11_STL_
2323
#define _WEBSOCKETPP_CONSTEXPR_TOKEN_
2424
#define _SCL_SECURE_NO_WARNINGS
@@ -31,8 +31,6 @@
3131
#pragma clang diagnostic ignored "-Wshorten-64-to-32"
3232
#endif
3333

34-
#pragma warning(disable: 4244)
35-
3634
#include <websocketpp/config/asio_client.hpp>
3735
#include <websocketpp/config/asio_no_tls_client.hpp>
3836
#include <websocketpp/client.hpp>

0 commit comments

Comments
 (0)