Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warnings with Visual Studio 2022, Warning Level 4 #108

Open
kahramonj opened this issue Jun 27, 2023 · 0 comments
Open

Warnings with Visual Studio 2022, Warning Level 4 #108

kahramonj opened this issue Jun 27, 2023 · 0 comments

Comments

@kahramonj
Copy link

Hi, we are getting a lot of warnings while compiling the SDK with the Visual Studio 2022 compiler, C++ 17 Standard, Warning Level 4.
The warnings are listed below. Is it possible to fix it please?

4>sdk\include\sl_lidar_protocol.h(58,11): warning C4200: nonstandard extension used: zero-sized array in struct/union
4>sdk\include\sl_lidar_protocol.h(58,11): message : This member will be ignored by a defaulted constructor or copy/move assignment operator
4>sdk\include\sl_lidar_cmd.h(295,12): warning C4200: nonstandard extension used: zero-sized array in struct/union
4>sdk\include\sl_lidar_cmd.h(295,12): message : This member will be ignored by a defaulted constructor or copy/move assignment operator

4>rplidar_driver.cpp
4>sdk\include\sl_lidar_protocol.h(58,11): warning C4200: nonstandard extension used: zero-sized array in struct/union
4>sdk\include\sl_lidar_protocol.h(58,11): message : This member will be ignored by a defaulted constructor or copy/move assignment operator
4>sdk\include\sl_lidar_cmd.h(295,12): warning C4200: nonstandard extension used: zero-sized array in struct/union
4>sdk\include\sl_lidar_cmd.h(295,12): message : This member will be ignored by a defaulted constructor or copy/move assignment operator
4>sdk\src\hal\event.h(108,1): warning C4245: 'return': conversion from 'rp::hal::Event::<unnamed-enum-EVENT_OK>' to 'unsigned long', signed/unsigned mismatch
4>sl_crc.cpp
4>sdk\include\sl_lidar_protocol.h(58,11): warning C4200: nonstandard extension used: zero-sized array in struct/union
4>sdk\include\sl_lidar_protocol.h(58,11): message : This member will be ignored by a defaulted constructor or copy/move assignment operator
4>sdk\include\sl_lidar_cmd.h(295,12): warning C4200: nonstandard extension used: zero-sized array in struct/union
4>sdk\include\sl_lidar_cmd.h(295,12): message : This member will be ignored by a defaulted constructor or copy/move assignment operator
4>sdk\src\sl_crc.cpp(100,37): warning C4244: 'argument': conversion from 'sl_u32' to 'sl_u16', possible loss of data
4>sl_lidar_driver.cpp
4>sdk\include\sl_lidar_protocol.h(58,11): warning C4200: nonstandard extension used: zero-sized array in struct/union
4>sdk\include\sl_lidar_protocol.h(58,11): message : This member will be ignored by a defaulted constructor or copy/move assignment operator
4>sdk\include\sl_lidar_cmd.h(295,12): warning C4200: nonstandard extension used: zero-sized array in struct/union
4>sdk\include\sl_lidar_cmd.h(295,12): message : This member will be ignored by a defaulted constructor or copy/move assignment operator
4>sdk\src\hal\event.h(108,1): warning C4245: 'return': conversion from 'rp::hal::Event::<unnamed-enum-EVENT_OK>' to 'unsigned long', signed/unsigned mismatch
4>sdk\src\sl_lidar_driver.cpp(133,34): warning C4244: '=': conversion from 'sl_u32' to 'sl_u16', possible loss of data
4>sdk\src\sl_lidar_driver.cpp(473,41): warning C4244: '=': conversion from 'sl_u32' to 'sl_u16', possible loss of data
4>sdk\src\sl_lidar_driver.cpp(647,1): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
4>sdk\src\sl_lidar_driver.cpp(682,1): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
4>sdk\src\sl_lidar_driver.cpp(876,1): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
4>sdk\src\sl_lidar_driver.cpp(914,1): warning C4245: 'initializing': conversion from 'int' to 'sl_u32', signed/unsigned mismatch
4>sdk\src\sl_lidar_driver.cpp(1001,1): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
4>sdk\src\sl_lidar_driver.cpp(1082,34): warning C4244: 'argument': conversion from 'sl_u16' to '_Ty', possible loss of data
4> with
4> [
4> _Ty=sl_u8
4> ]
4>sdk\src\sl_lidar_driver.cpp(1091,1): warning C4267: 'initializing': conversion from 'size_t' to 'sl_u8', possible loss of data
4>sdk\src\sl_lidar_driver.cpp(1071,19): warning C4101: 'pkt_header': unreferenced local variable
4>sdk\src\sl_lidar_driver.cpp(1422,52): warning C4244: '=': conversion from 'int' to 'sl_u8', possible loss of data
4>sdk\src\sl_lidar_driver.cpp(1555,52): warning C4244: '=': conversion from 'int' to 'sl_u8', possible loss of data
4>sdk\src\sl_lidar_driver.cpp(1609,42): warning C4244: '=': conversion from 'int' to 'sl_u8', possible loss of data
4>sdk\src\sl_lidar_driver.cpp(59,17): warning C4505: 'sl::printDeprecationWarn': unreferenced function with internal linkage has been removed
4>sdk\src\sl_lidar_driver.cpp(72,17): warning C4505: 'sl::convert': unreferenced function with internal linkage has been removed
4>sl_serial_channel.cpp
4>sdk\include\sl_lidar_protocol.h(58,11): warning C4200: nonstandard extension used: zero-sized array in struct/union
4>sdk\include\sl_lidar_protocol.h(58,11): message : This member will be ignored by a defaulted constructor or copy/move assignment operator
4>sdk\include\sl_lidar_cmd.h(295,12): warning C4200: nonstandard extension used: zero-sized array in struct/union
4>sdk\include\sl_lidar_cmd.h(295,12): message : This member will be ignored by a defaulted constructor or copy/move assignment operator
4>sdk\src\sl_serial_channel.cpp(95,1): warning C4267: 'return': conversion from 'size_t' to 'int', possible loss of data
4>sl_tcp_channel.cpp
4>sdk\include\sl_lidar_protocol.h(58,11): warning C4200: nonstandard extension used: zero-sized array in struct/union
4>sdk\include\sl_lidar_protocol.h(58,11): message : This member will be ignored by a defaulted constructor or copy/move assignment operator
4>sdk\include\sl_lidar_cmd.h(295,12): warning C4200: nonstandard extension used: zero-sized array in struct/union
4>sdk\include\sl_lidar_cmd.h(295,12): message : This member will be ignored by a defaulted constructor or copy/move assignment operator
4>sdk\src\sl_tcp_channel.cpp(57,16): warning C4806: '&': unsafe operation: no value of type 'bool' promoted to type 'unsigned int' can equal the given constant
4>sdk\src\sl_tcp_channel.cpp(90,1): warning C4267: 'return': conversion from 'size_t' to 'int', possible loss of data
4>sl_udp_channel.cpp
4>sdk\include\sl_lidar_protocol.h(58,11): warning C4200: nonstandard extension used: zero-sized array in struct/union
4>sdk\include\sl_lidar_protocol.h(58,11): message : This member will be ignored by a defaulted constructor or copy/move assignment operator
4>sdk\include\sl_lidar_cmd.h(295,12): warning C4200: nonstandard extension used: zero-sized array in struct/union
4>sdk\include\sl_lidar_cmd.h(295,12): message : This member will be ignored by a defaulted constructor or copy/move assignment operator
4>sdk\src\sl_udp_channel.cpp(56,16): warning C4806: '&': unsafe operation: no value of type 'bool' promoted to type 'unsigned int' can equal the given constant
4>sdk\src\sl_udp_channel.cpp(97,1): warning C4267: 'return': conversion from 'size_t' to 'int', possible loss of data
4>thread.cpp
4>sdk\include\sl_lidar_protocol.h(58,11): warning C4200: nonstandard extension used: zero-sized array in struct/union
4>sdk\include\sl_lidar_protocol.h(58,11): message : This member will be ignored by a defaulted constructor or copy/move assignment operator
4>sdk\include\sl_lidar_cmd.h(295,12): warning C4200: nonstandard extension used: zero-sized array in struct/union
4>sdk\include\sl_lidar_cmd.h(295,12): message : This member will be ignored by a defaulted constructor or copy/move assignment operator
4>sdk\src\arch\win32\winthread.hpp(53,8): warning C4312: 'reinterpret_cast': conversion from '_word_size_t' to 'HANDLE' of greater size
4>sdk\src\arch\win32\winthread.hpp(53,8): warning C4245: 'argument': conversion from 'int' to 'DWORD', signed/unsigned mismatch
4>sdk\src\arch\win32\winthread.hpp(55,59): warning C4312: 'reinterpret_cast': conversion from '_word_size_t' to 'HANDLE' of greater size
4>sdk\src\arch\win32\winthread.hpp(88,5): warning C4312: 'reinterpret_cast': conversion from '_word_size_t' to 'HANDLE' of greater size
4>sdk\src\arch\win32\winthread.hpp(98,80): warning C4312: 'reinterpret_cast': conversion from '_word_size_t' to 'HANDLE' of greater size
4>sdk\src\arch\win32\winthread.hpp(129,12): warning C4312: 'reinterpret_cast': conversion from '_word_size_t' to 'HANDLE' of greater size
4>sdk\src\arch\win32\winthread.hpp(132,59): warning C4312: 'reinterpret_cast': conversion from '_word_size_t' to 'HANDLE' of greater size
4>timer.cpp
4>sdk\include\sl_lidar_protocol.h(58,11): warning C4200: nonstandard extension used: zero-sized array in struct/union
4>sdk\include\sl_lidar_protocol.h(58,11): message : This member will be ignored by a defaulted constructor or copy/move assignment operator
4>sdk\include\sl_lidar_cmd.h(295,12): warning C4200: nonstandard extension used: zero-sized array in struct/union
4>sdk\include\sl_lidar_cmd.h(295,12): message : This member will be ignored by a defaulted constructor or copy/move assignment operator
4>sdk\src\arch\win32\timer.cpp(45,10): warning C4189: 'ans': local variable is initialized but not referenced
4>net_socket.cpp
4>sdk\include\sl_lidar_protocol.h(58,11): warning C4200: nonstandard extension used: zero-sized array in struct/union
4>sdk\include\sl_lidar_protocol.h(58,11): message : This member will be ignored by a defaulted constructor or copy/move assignment operator
4>sdk\include\sl_lidar_cmd.h(295,12): warning C4200: nonstandard extension used: zero-sized array in struct/union
4>sdk\include\sl_lidar_cmd.h(295,12): message : This member will be ignored by a defaulted constructor or copy/move assignment operator
4>sdk\src\arch\win32\net_socket.cpp(48,25): warning C4244: '=': conversion from 'int' to 'ADDRESS_FAMILY', possible loss of data
4>sdk\src\arch\win32\net_socket.cpp(66,9): warning C4189: 'rv': local variable is initialized but not referenced
4>sdk\src\arch\win32\net_socket.cpp(238,47): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data
4>sdk\src\arch\win32\net_socket.cpp(243,47): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data
4>sdk\src\arch\win32\net_socket.cpp(514,1): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data
4>sdk\src\arch\win32\net_socket.cpp(533,1): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data
4>sdk\src\arch\win32\net_socket.cpp(629,38): warning C4244: 'argument': conversion from 'SOCKET' to 'int', possible loss of data
4>sdk\src\arch\win32\net_socket.cpp(888,19): warning C4244: 'initializing': conversion from 'SOCKET' to 'int', possible loss of data
4>sdk\src\arch\win32\net_socket.cpp(902,19): warning C4244: 'initializing': conversion from 'SOCKET' to 'int', possible loss of data
4>net_serial.cpp
4>sdk\include\sl_lidar_protocol.h(58,11): warning C4200: nonstandard extension used: zero-sized array in struct/union
4>sdk\include\sl_lidar_protocol.h(58,11): message : This member will be ignored by a defaulted constructor or copy/move assignment operator
4>sdk\include\sl_lidar_cmd.h(295,12): warning C4200: nonstandard extension used: zero-sized array in struct/union
4>sdk\include\sl_lidar_cmd.h(295,12): message : This member will be ignored by a defaulted constructor or copy/move assignment operator
4>sdk\src\arch\win32\net_serial.cpp(146,32): warning C4245: 'initializing': conversion from 'int' to 'DWORD', signed/unsigned mismatch
4>sdk\src\arch\win32\net_serial.cpp(154,7): warning C4267: 'argument': conversion from 'size_t' to 'DWORD', possible loss of data
4>sdk\src\arch\win32\net_serial.cpp(156,32): warning C4245: '=': conversion from 'rp::hal::serial_rxtx::<unnamed-enum-ANS_OK>' to 'DWORD', signed/unsigned mismatch
4>sdk\src\arch\win32\net_serial.cpp(146,22): warning C4189: 'o_len': local variable is initialized but not referenced
4>sdk\src\arch\win32\net_serial.cpp(167,7): warning C4267: 'argument': conversion from 'size_t' to 'DWORD', possible loss of data
4>sdk\src\arch\win32\net_serial.cpp(197,26): warning C4245: '=': conversion from 'rp::hal::serial_rxtx::<unnamed-enum-ANS_OK>' to '_word_size_t', signed/unsigned mismatch
4>sdk\src\arch\win32\net_serial.cpp(202,26): warning C4245: '=': conversion from 'rp::hal::serial_rxtx::<unnamed-enum-ANS_OK>' to '_word_size_t', signed/unsigned mismatch
4>sdk\src\arch\win32\net_serial.cpp(217,26): warning C4245: '=': conversion from 'rp::hal::serial_rxtx::<unnamed-enum-ANS_OK>' to '_word_size_t', signed/unsigned mismatch
4>sdk\src\arch\win32\net_serial.cpp(221,26): warning C4245: '=': conversion from 'rp::hal::serial_rxtx::<unnamed-enum-ANS_OK>' to '_word_size_t', signed/unsigned mismatch
4>sdk\src\arch\win32\net_serial.cpp(293,11): warning C4189: 'r_len': local variable is initialized but not referenced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant