mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 17:33:34 +08:00
mavlink: fix compiler warnings with GCC 8.0.1
-Wno-extra-semi is not valid for C code
This commit is contained in:
@@ -39,7 +39,6 @@ px4_add_module(
|
||||
STACK_MAIN 1200
|
||||
STACK_MAX 1500
|
||||
COMPILE_FLAGS
|
||||
-Wno-extra-semi
|
||||
-Wno-sign-compare # TODO: fix all sign-compare
|
||||
INCLUDES
|
||||
${PX4_SOURCE_DIR}/mavlink/include/mavlink
|
||||
|
||||
@@ -431,6 +431,9 @@ MavlinkParametersManager::send_uavcan()
|
||||
mavlink_param_value_t msg;
|
||||
msg.param_count = value.param_count;
|
||||
msg.param_index = value.param_index;
|
||||
#if defined(__GNUC__) && __GNUC__ >= 8
|
||||
#pragma GCC diagnostic ignored "-Wstringop-truncation"
|
||||
#endif
|
||||
/*
|
||||
* coverity[buffer_size_warning : FALSE]
|
||||
*
|
||||
@@ -439,6 +442,9 @@ MavlinkParametersManager::send_uavcan()
|
||||
* when copying it.
|
||||
*/
|
||||
strncpy(msg.param_id, value.param_id, MAVLINK_MSG_PARAM_VALUE_FIELD_PARAM_ID_LEN);
|
||||
#if defined(__GNUC__) && __GNUC__ >= 8
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
if (value.param_type == MAV_PARAM_TYPE_REAL32) {
|
||||
msg.param_type = MAVLINK_TYPE_FLOAT;
|
||||
@@ -547,6 +553,9 @@ MavlinkParametersManager::send_param(param_t param, int component_id)
|
||||
msg.param_count = param_count_used();
|
||||
msg.param_index = param_get_used_index(param);
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ >= 8
|
||||
#pragma GCC diagnostic ignored "-Wstringop-truncation"
|
||||
#endif
|
||||
/*
|
||||
* coverity[buffer_size_warning : FALSE]
|
||||
*
|
||||
@@ -555,6 +564,9 @@ MavlinkParametersManager::send_param(param_t param, int component_id)
|
||||
* when copying it.
|
||||
*/
|
||||
strncpy(msg.param_id, param_name(param), MAVLINK_MSG_PARAM_VALUE_FIELD_PARAM_ID_LEN);
|
||||
#if defined(__GNUC__) && __GNUC__ >= 8
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
/* query parameter type */
|
||||
param_type_t type = param_type(param);
|
||||
|
||||
@@ -43,7 +43,6 @@ px4_add_module(
|
||||
#-DMAVLINK_FTP_DEBUG
|
||||
-DMavlinkStream=MavlinkStreamTest
|
||||
-DMavlinkFTP=MavlinkFTPTest
|
||||
-Wno-extra-semi
|
||||
SRCS
|
||||
mavlink_tests.cpp
|
||||
mavlink_ftp_test.cpp
|
||||
|
||||
Reference in New Issue
Block a user