From 970b56db8ba1433c86a5379ad85e55a762be6af6 Mon Sep 17 00:00:00 2001 From: luozihao <1165977584@qq.com> Date: Tue, 13 Jun 2023 20:39:20 +0800 Subject: [PATCH] =?UTF-8?q?CM=E9=80=82=E9=85=8DGCC10.3=E7=BC=96=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cm_agent/client_adpts/libpq/cma_datanode_check.cpp | 3 +++ src/cm_ctl/cm_ctl.cpp | 1 + src/cm_ctl/ctl_param_check.cpp | 3 +-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/cm_agent/client_adpts/libpq/cma_datanode_check.cpp b/src/cm_agent/client_adpts/libpq/cma_datanode_check.cpp index dc177e3..276f145 100644 --- a/src/cm_agent/client_adpts/libpq/cma_datanode_check.cpp +++ b/src/cm_agent/client_adpts/libpq/cma_datanode_check.cpp @@ -312,7 +312,10 @@ static status_t GetMatchPoint(char *text, char matchPoint, uint32 *point) while (CM_IS_QUOTE_CHAR(text[tempPoint])) { if (text[strlen(text) - 1] == text[tempPoint]) { + /* This tells the compiler that there will be no overflow issues */ +#pragma GCC diagnostic ignored "-Wstringop-overflow" text[strlen(text) - 1] = '\0'; +#pragma GCC diagnostic pop } if ((tempPoint + 1) >= strlen(text)) { write_runlog(ERROR, "%d failed to getMatchPoint, bacause text=[%s], point=[%u: %zu].\n", diff --git a/src/cm_ctl/cm_ctl.cpp b/src/cm_ctl/cm_ctl.cpp index c91305a..b8ab67a 100644 --- a/src/cm_ctl/cm_ctl.cpp +++ b/src/cm_ctl/cm_ctl.cpp @@ -43,6 +43,7 @@ #include "config.h" #include "cm_util.h" #include "ctl_help.h" +#include #define ETCD_NUM_UPPER_LIMIT 50 diff --git a/src/cm_ctl/ctl_param_check.cpp b/src/cm_ctl/ctl_param_check.cpp index a5acc7d..ec0e443 100644 --- a/src/cm_ctl/ctl_param_check.cpp +++ b/src/cm_ctl/ctl_param_check.cpp @@ -379,8 +379,7 @@ static status_t GetConfigParamValue(const char *ptr, ParamEnumEntry &varList) int ret; if (ptr == NULL) { - write_runlog(DEBUG1, "Failed to parse the \"%s\" info. The value range information \"%s\" is incorrect.\n", - varList.name, ptr); + write_runlog(DEBUG1, "Failed to parse the \"%s\" info. The value is null.\n", varList.name); return CM_ERROR; }