消除编译时调用securec_check带来的警告

This commit is contained in:
vastdata-xyzr
2023-09-12 10:22:33 +08:00
parent 0842a954ed
commit b9f18a69fa
2 changed files with 3 additions and 3 deletions

View File

@ -5700,7 +5700,7 @@ static void eraseSingleQuotes(char* query_string)
* Report error according to the return value. * Report error according to the return value.
* At the same time, we should free the space alloced by developers. * At the same time, we should free the space alloced by developers.
*/ */
void freeSecurityFuncSpace(char* charList, ...) void freeSecurityFuncSpace(const char* charList, ...)
{ {
va_list argptr; va_list argptr;

View File

@ -315,7 +315,7 @@ typedef struct FormatCallStack {
#define securec_check(errno, charList, ...) \ #define securec_check(errno, charList, ...) \
{ \ { \
if (EOK != errno) { \ if (EOK != errno) { \
freeSecurityFuncSpace(static_cast<char*>(charList), ##__VA_ARGS__); \ freeSecurityFuncSpace(charList, ##__VA_ARGS__); \
switch (errno) { \ switch (errno) { \
case EINVAL: \ case EINVAL: \
elog(ERROR, \ elog(ERROR, \
@ -668,7 +668,7 @@ extern void write_stderr_with_prefix(const char* fmt, ...)
extern void getElevelAndSqlstate(int* eLevel, int* sqlState); extern void getElevelAndSqlstate(int* eLevel, int* sqlState);
extern void get_time_now(char* nowTime, int timeLen); extern void get_time_now(char* nowTime, int timeLen);
void freeSecurityFuncSpace(char* charList, ...); void freeSecurityFuncSpace(const char* charList, ...);
extern void SimpleLogToServer(int elevel, bool silent, const char* fmt, ...) extern void SimpleLogToServer(int elevel, bool silent, const char* fmt, ...)
__attribute__((format(PG_PRINTF_ATTRIBUTE, 3, 4))); __attribute__((format(PG_PRINTF_ATTRIBUTE, 3, 4)));