add compile flag to treat all warnings as errors.
[TD-118]
This commit is contained in:
parent
508ce47d02
commit
77c6f616f9
|
@ -107,12 +107,12 @@ IF (TD_LINUX_64)
|
|||
SET(RELEASE_FLAGS "-O0")
|
||||
IF (NOT TD_ARM)
|
||||
IF (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
|
||||
SET(COMMON_FLAGS "-std=gnu99 -Wall -fPIC -malign-double -g3 -gdwarf-2 -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE")
|
||||
SET(COMMON_FLAGS "-std=gnu99 -Wall -Werror -Wno-missing-braces -fPIC -g3 -gdwarf-2 -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE")
|
||||
ELSE ()
|
||||
SET(COMMON_FLAGS "-std=gnu99 -Wall -fPIC -malign-double -g3 -gdwarf-2 -malign-stringops -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE")
|
||||
SET(COMMON_FLAGS "-std=gnu99 -Wall -Werror -fPIC -malign-double -g3 -gdwarf-2 -malign-stringops -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE")
|
||||
ENDIF ()
|
||||
ELSE ()
|
||||
SET(COMMON_FLAGS "-std=gnu99 -Wall -fPIC -g -fsigned-char -fpack-struct=8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE")
|
||||
SET(COMMON_FLAGS "-std=gnu99 -Wall -Werror -fPIC -g -fsigned-char -fpack-struct=8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE")
|
||||
ENDIF ()
|
||||
ADD_DEFINITIONS(-DLINUX)
|
||||
ADD_DEFINITIONS(-D_REENTRANT -D__USE_POSIX -D_LIBC_REENTRANT)
|
||||
|
@ -128,7 +128,7 @@ IF (TD_LINUX_64)
|
|||
ENDIF ()
|
||||
SET(DEBUG_FLAGS "-O0 -DDEBUG")
|
||||
SET(RELEASE_FLAGS "-O0")
|
||||
SET(COMMON_FLAGS "-std=gnu99 -Wall -fPIC -g -fsigned-char -munaligned-access -fpack-struct=8 -latomic -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE")
|
||||
SET(COMMON_FLAGS "-std=gnu99 -Wall -Werror -fPIC -g -fsigned-char -munaligned-access -fpack-struct=8 -latomic -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE")
|
||||
ADD_DEFINITIONS(-DLINUX)
|
||||
ADD_DEFINITIONS(-D_REENTRANT -D__USE_POSIX -D_LIBC_REENTRANT)
|
||||
ADD_DEFINITIONS(-DUSE_LIBICONV)
|
||||
|
@ -141,7 +141,7 @@ IF (TD_LINUX_64)
|
|||
ELSEIF (TD_WINDOWS_64)
|
||||
SET(CMAKE_GENERATOR "NMake Makefiles" CACHE INTERNAL "" FORCE)
|
||||
IF (NOT TD_GODLL)
|
||||
SET(COMMON_FLAGS "/nologo /WX- /Oi /Oy- /Gm- /EHsc /MT /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Gd /errorReport:prompt /analyze-")
|
||||
SET(COMMON_FLAGS "/nologo /WX /Oi /Oy- /Gm- /EHsc /MT /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Gd /errorReport:prompt /analyze-")
|
||||
SET(DEBUG_FLAGS "/Zi /W3 /GL")
|
||||
SET(RELEASE_FLAGS "/W0 /GL")
|
||||
ENDIF ()
|
||||
|
@ -151,7 +151,7 @@ IF (TD_LINUX_64)
|
|||
ADD_DEFINITIONS(-DPTW32_BUILD)
|
||||
ADD_DEFINITIONS(-D_MBCS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
|
||||
ELSEIF (TD_DARWIN_64)
|
||||
SET(COMMON_FLAGS "-std=gnu99 -Wall -fPIC -malign-double -g -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE")
|
||||
SET(COMMON_FLAGS "-std=gnu99 -Wall -Werror -Wno-missing-braces -fPIC -g -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE")
|
||||
SET(DEBUG_FLAGS "-O0 -DDEBUG")
|
||||
SET(RELEASE_FLAGS "-O0")
|
||||
ADD_DEFINITIONS(-DDARWIN)
|
||||
|
@ -159,4 +159,4 @@ IF (TD_LINUX_64)
|
|||
ELSE ()
|
||||
MESSAGE(FATAL_ERROR "The current platform is not support yet, stop compile")
|
||||
EXIT ()
|
||||
ENDIF ()
|
||||
ENDIF ()
|
||||
|
|
|
@ -210,7 +210,7 @@ char* tsGetTagsValue(STableMeta* pTableMeta) {
|
|||
}
|
||||
|
||||
// todo refactor
|
||||
static FORCE_INLINE char* skipSegments(char* input, char delim, int32_t num) {
|
||||
__attribute__ ((unused))static FORCE_INLINE char* skipSegments(char* input, char delim, int32_t num) {
|
||||
for (int32_t i = 0; i < num; ++i) {
|
||||
while (*input != 0 && *input++ != delim) {
|
||||
};
|
||||
|
@ -218,7 +218,7 @@ static FORCE_INLINE char* skipSegments(char* input, char delim, int32_t num) {
|
|||
return input;
|
||||
}
|
||||
|
||||
static FORCE_INLINE size_t copy(char* dst, const char* src, char delimiter) {
|
||||
__attribute__ ((unused)) static FORCE_INLINE size_t copy(char* dst, const char* src, char delimiter) {
|
||||
size_t len = 0;
|
||||
while (*src != delimiter && *src != 0) {
|
||||
*dst++ = *src++;
|
||||
|
|
|
@ -108,7 +108,7 @@ static SSub* tscCreateSubscription(STscObj* pObj, const char* topic, const char*
|
|||
if (pSql == NULL) {
|
||||
terrno = TSDB_CODE_CLI_OUT_OF_MEMORY;
|
||||
tscError("failed to allocate SSqlObj for subscription");
|
||||
goto failed;
|
||||
goto _pSql_failed;
|
||||
}
|
||||
|
||||
pSql->signature = pSql;
|
||||
|
@ -137,13 +137,11 @@ static SSub* tscCreateSubscription(STscObj* pObj, const char* topic, const char*
|
|||
return pSub;
|
||||
|
||||
failed:
|
||||
if (sqlstr != NULL) {
|
||||
free(sqlstr);
|
||||
}
|
||||
if (pSql != NULL) {
|
||||
free(pSql);
|
||||
}
|
||||
free(pSub);
|
||||
tfree(sqlstr);
|
||||
|
||||
_pSql_failed:
|
||||
tfree(pSql);
|
||||
tfree(pSub);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include "ttokendef.h"
|
||||
|
||||
// todo refactor
|
||||
static FORCE_INLINE const char* skipSegments(const char* input, char delim, int32_t num) {
|
||||
__attribute__((unused)) static FORCE_INLINE const char* skipSegments(const char* input, char delim, int32_t num) {
|
||||
for (int32_t i = 0; i < num; ++i) {
|
||||
while (*input != 0 && *input++ != delim) {
|
||||
};
|
||||
|
@ -14,7 +14,7 @@ static FORCE_INLINE const char* skipSegments(const char* input, char delim, int3
|
|||
return input;
|
||||
}
|
||||
|
||||
static FORCE_INLINE size_t copy(char* dst, const char* src, char delimiter) {
|
||||
__attribute__((unused)) static FORCE_INLINE size_t copy(char* dst, const char* src, char delimiter) {
|
||||
size_t len = 0;
|
||||
while (*src != delimiter && *src != 0) {
|
||||
*dst++ = *src++;
|
||||
|
|
|
@ -753,12 +753,12 @@ typedef struct {
|
|||
|
||||
typedef struct {
|
||||
int32_t numOfQueries;
|
||||
SQueryDesc qdesc[];
|
||||
SQueryDesc *qdesc;
|
||||
} SQqueryList;
|
||||
|
||||
typedef struct {
|
||||
int32_t numOfStreams;
|
||||
SStreamDesc sdesc[];
|
||||
SStreamDesc *sdesc;
|
||||
} SStreamList;
|
||||
|
||||
typedef struct {
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
*/
|
||||
|
||||
#ifndef TDENGINE_MGMT_GRANT_H
|
||||
#define TDENGINE_MGMT_GTANT_H
|
||||
#define TDENGINE_MGMT_GRANT_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
"C" {
|
||||
|
|
|
@ -38,7 +38,7 @@ typedef struct SLoserTreeInfo {
|
|||
SLoserTreeNode *pNode;
|
||||
} SLoserTreeInfo;
|
||||
|
||||
uint8_t tLoserTreeCreate(SLoserTreeInfo **pTree, int32_t numOfEntries, void *param, __merge_compare_fn_t compareFn);
|
||||
uint32_t tLoserTreeCreate(SLoserTreeInfo **pTree, int32_t numOfEntries, void *param, __merge_compare_fn_t compareFn);
|
||||
|
||||
void tLoserTreeInit(SLoserTreeInfo *pTree);
|
||||
|
||||
|
|
|
@ -5707,7 +5707,7 @@ static SQInfo *createQInfoImpl(SQueryTableMsg *pQueryMsg, SSqlGroupbyExpr *pGrou
|
|||
SArray *pTableIdList) {
|
||||
SQInfo *pQInfo = (SQInfo *)calloc(1, sizeof(SQInfo));
|
||||
if (pQInfo == NULL) {
|
||||
goto _clean_memory;
|
||||
goto _clean_pQInfo_memory;
|
||||
}
|
||||
|
||||
SQuery *pQuery = calloc(1, sizeof(SQuery));
|
||||
|
@ -5836,6 +5836,7 @@ _clean_memory:
|
|||
tfree(pExprs);
|
||||
tfree(pGroupbyExpr);
|
||||
|
||||
_clean_pQInfo_memory:
|
||||
tfree(pQInfo);
|
||||
|
||||
return NULL;
|
||||
|
@ -6213,4 +6214,4 @@ int32_t qDumpRetrieveResult(SQInfo *pQInfo, SRetrieveTableRsp** pRsp, int32_t* c
|
|||
// vnodeDecRefCount(pObj->qhandle);
|
||||
// pObj->qhandle = NULL;
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ void tLoserTreeDisplay(SLoserTreeInfo* pTree) {
|
|||
printf("\n");
|
||||
}
|
||||
|
||||
uint8_t tLoserTreeCreate(SLoserTreeInfo** pTree, int32_t numOfEntries, void* param, __merge_compare_fn_t compareFn) {
|
||||
uint32_t tLoserTreeCreate(SLoserTreeInfo** pTree, int32_t numOfEntries, void* param, __merge_compare_fn_t compareFn) {
|
||||
int32_t totalEntries = numOfEntries << 1;
|
||||
|
||||
*pTree = (SLoserTreeInfo*)calloc(1, sizeof(SLoserTreeInfo) + sizeof(SLoserTreeNode) * totalEntries);
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#include "tskiplist.h"
|
||||
#include "tutil.h"
|
||||
|
||||
static FORCE_INLINE void recordNodeEachLevel(SSkipList *pSkipList, int32_t level) { // record link count in each level
|
||||
__attribute__ ((unused)) static FORCE_INLINE void recordNodeEachLevel(SSkipList *pSkipList, int32_t level) { // record link count in each level
|
||||
#if SKIP_LIST_RECORD_PERFORMANCE
|
||||
for (int32_t i = 0; i < level; ++i) {
|
||||
pSkipList->state.nLevelNodeCnt[i]++;
|
||||
|
@ -26,7 +26,7 @@ static FORCE_INLINE void recordNodeEachLevel(SSkipList *pSkipList, int32_t level
|
|||
#endif
|
||||
}
|
||||
|
||||
static FORCE_INLINE void removeNodeEachLevel(SSkipList *pSkipList, int32_t level) {
|
||||
__attribute__ ((unused)) static FORCE_INLINE void removeNodeEachLevel(SSkipList *pSkipList, int32_t level) {
|
||||
#if SKIP_LIST_RECORD_PERFORMANCE
|
||||
for (int32_t i = 0; i < level; ++i) {
|
||||
pSkipList->state.nLevelNodeCnt[i]--;
|
||||
|
|
Loading…
Reference in New Issue