From 1067175746851366b658b0b2b590f77ff915642f Mon Sep 17 00:00:00 2001 From: Bomin Zhang Date: Mon, 20 Jul 2020 11:15:32 +0800 Subject: [PATCH] fix compiler error --- src/client/src/tscSub.c | 3 ++- tests/examples/c/makefile | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/client/src/tscSub.c b/src/client/src/tscSub.c index 73614fa0a5..526f380475 100644 --- a/src/client/src/tscSub.c +++ b/src/client/src/tscSub.c @@ -92,6 +92,7 @@ static void asyncCallback(void *param, TAOS_RES *tres, int code) { static SSub* tscCreateSubscription(STscObj* pObj, const char* topic, const char* sql) { int code = TSDB_CODE_SUCCESS, line = __LINE__; + SSqlObj* pSql = NULL; SSub* pSub = calloc(1, sizeof(SSub)); if (pSub == NULL) { @@ -113,7 +114,7 @@ static SSub* tscCreateSubscription(STscObj* pObj, const char* topic, const char* goto fail; } - SSqlObj* pSql = calloc(1, sizeof(SSqlObj)); + pSql = calloc(1, sizeof(SSqlObj)); if (pSql == NULL) { line = __LINE__; code = TSDB_CODE_TSC_OUT_OF_MEMORY; diff --git a/tests/examples/c/makefile b/tests/examples/c/makefile index 0a4b8ee9d2..f9653c9c96 100644 --- a/tests/examples/c/makefile +++ b/tests/examples/c/makefile @@ -4,7 +4,6 @@ ROOT=./ TARGET=exe LFLAGS = '-Wl,-rpath,/usr/local/taos/driver/' -ltaos -lpthread -lm -lrt -#LFLAGS = '-Wl,-rpath,/home/zbm/project/td/debug/build/lib/' -L/home/zbm/project/td/debug/build/lib -ltaos -lpthread -lm -lrt CFLAGS = -O3 -g -Wall -Wno-deprecated -fPIC -Wno-unused-result -Wconversion -Wno-char-subscripts -D_REENTRANT -Wno-format -D_REENTRANT -DLINUX -msse4.2 -Wno-unused-function -D_M_X64 \ -I/usr/local/taos/include -std=gnu99 @@ -16,6 +15,7 @@ exe: gcc $(CFLAGS) ./prepare.c -o $(ROOT)/prepare $(LFLAGS) gcc $(CFLAGS) ./stream.c -o $(ROOT)/stream $(LFLAGS) gcc $(CFLAGS) ./subscribe.c -o $(ROOT)subscribe $(LFLAGS) + gcc $(CFLAGS) ./apitest.c -o $(ROOT)apitest $(LFLAGS) clean: rm $(ROOT)/asyncdemo -- GitLab