From bf3e10c36e2aca09eb5d72fbec1eadcba696e00f Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Mon, 17 Feb 2025 11:42:10 +0800 Subject: [PATCH] fix: compile errors --- source/os/src/osTimer.c | 12 +++++++++++- tools/shell/src/shellEngine.c | 4 ++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/source/os/src/osTimer.c b/source/os/src/osTimer.c index 98cbd968fc..12a43925cd 100644 --- a/source/os/src/osTimer.c +++ b/source/os/src/osTimer.c @@ -78,10 +78,17 @@ void taos_block_sigalrm(void) { #include #include +static void taosDeleteTimer(void *tharg) { + timer_t *pTimer = tharg; + TAOS_SKIP_ERROR(timer_delete(*pTimer)); +} + static TdThread timerThread; static timer_t timerId; static volatile bool stopTimer = false; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstringop-overflow" static void *taosProcessAlarmSignal(void *tharg) { // Block the signal sigset_t sigset; @@ -109,6 +116,8 @@ static void *taosProcessAlarmSignal(void *tharg) { return NULL; } + taosThreadCleanupPush(taosDeleteTimer, &timerId); + do { struct itimerspec ts; ts.it_value.tv_sec = 0; @@ -134,10 +143,11 @@ static void *taosProcessAlarmSignal(void *tharg) { } } while (0); - timer_delete(timerId); + taosThreadCleanupPop(1); return NULL; } +#pragma GCC diagnostic pop #endif int taosInitTimer(void (*callback)(int), int ms) { diff --git a/tools/shell/src/shellEngine.c b/tools/shell/src/shellEngine.c index 37da47bae6..ebec4ca06c 100644 --- a/tools/shell/src/shellEngine.c +++ b/tools/shell/src/shellEngine.c @@ -1267,6 +1267,9 @@ void *shellCancelHandler(void *arg) { return NULL; } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstringop-overflow" + void *shellThreadLoop(void *arg) { setThreadName("shellThreadLoop"); taosGetOldTerminalMode(); @@ -1298,6 +1301,7 @@ void *shellThreadLoop(void *arg) { taosThreadCleanupPop(1); return NULL; } +#pragma GCC diagnostic pop int32_t shellExecute() { printf(shell.info.clientVersion, shell.info.cusName, taos_get_client_info(), shell.info.cusName);