chronoxor / CppServer

Ultra fast and low latency asynchronous socket server & client C++ library with support TCP, SSL, UDP, HTTP, HTTPS, WebSocket protocols and 10K connections problem solution
MIT License
1.43k stars 284 forks source link

Invalid left shift #53

Closed hellow554 closed 2 years ago

hellow554 commented 3 years ago
| /build/cppserver/1.0.0-r0/git/source/server/ws/ws.cpp: In member function 'void CppServer::WS::WebSocket::PrepareReceiveFrame(const void*, size_t)':
| /build/cppserver/1.0.0-r0/git/source/server/ws/ws.cpp:333:55: error: left shift count >= width of type [-Werror=shift-count-overflow]
|   333 |             payload = (((size_t)_ws_receive_buffer[2] << 56) | ((size_t)_ws_receive_buffer[3] << 48) | ((size_t)_ws_receive_buffer[4] << 40) | ((size_t)_ws_receive_buffer[5] << 32) | ((size_t)_ws_receive_buffer[6] << 24) | ((size_t)_ws_receive_buffer[7] << 16) | ((size_t)_ws_receive_buffer[8] << 8) | ((size_t)_ws_receive_buffer[9] << 0));
|       |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
| /build/cppserver/1.0.0-r0/git/source/server/ws/ws.cpp:333:95: error: left shift count >= width of type [-Werror=shift-count-overflow]
|   333 |             payload = (((size_t)_ws_receive_buffer[2] << 56) | ((size_t)_ws_receive_buffer[3] << 48) | ((size_t)_ws_receive_buffer[4] << 40) | ((size_t)_ws_receive_buffer[5] << 32) | ((size_t)_ws_receive_buffer[6] << 24) | ((size_t)_ws_receive_buffer[7] << 16) | ((size_t)_ws_receive_buffer[8] << 8) | ((size_t)_ws_receive_buffer[9] << 0));
|       |                                                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
| /build/cppserver/1.0.0-r0/git/source/server/ws/ws.cpp:333:135: error: left shift count >= width of type [-Werror=shift-count-overflow]
|   333 |             payload = (((size_t)_ws_receive_buffer[2] << 56) | ((size_t)_ws_receive_buffer[3] << 48) | ((size_t)_ws_receive_buffer[4] << 40) | ((size_t)_ws_receive_buffer[5] << 32) | ((size_t)_ws_receive_buffer[6] << 24) | ((size_t)_ws_receive_buffer[7] << 16) | ((size_t)_ws_receive_buffer[8] << 8) | ((size_t)_ws_receive_buffer[9] << 0));
|       |                                                                                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
| /build/cppserver/1.0.0-r0/git/source/server/ws/ws.cpp:333:175: error: left shift count >= width of type [-Werror=shift-count-overflow]
|   333 |             payload = (((size_t)_ws_receive_buffer[2] << 56) | ((size_t)_ws_receive_buffer[3] << 48) | ((size_t)_ws_receive_buffer[4] << 40) | ((size_t)_ws_receive_buffer[5] << 32) | ((size_t)_ws_receive_buffer[6] << 24) | ((size_t)_ws_receive_buffer[7] << 16) | ((size_t)_ws_receive_buffer[8] << 8) | ((size_t)_ws_receive_buffer[9] << 0));
|       |                                                                                                                                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~

I'm building for an arm platform where size_t is 32 bit

hellow554 commented 3 years ago

So it seems that none 64 bit platforms aren't supported yet... That's sad!

| /build/cppserver/1.0.0-r0/git/modules/CppBenchmark/source/benchmark/system.cpp:721:6: error: #error MulDiv64 is no supported!
|   721 |     #error MulDiv64 is no supported!
chronoxor commented 3 years ago

Arm is not supported and tested yet. If you managed to build under arm, please provide the PR.