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; }