diff --git a/frameworks/featured/hiview_log.c b/frameworks/featured/hiview_log.c index be4d704037abc55a96bd2e0f419a9ee525efc981..4b663410284e606ecf33131a52da72a9928d6690 100644 --- a/frameworks/featured/hiview_log.c +++ b/frameworks/featured/hiview_log.c @@ -35,7 +35,9 @@ static RegisterFunc g_registerFunc = NULL; static atomic_int g_hiLogGetIdCallCount = 0; #endif +#ifndef SECUREC_BUFFER_SIZE #define SECUREC_BUFFER_SIZE 256 +#endif #define SECUREC_MAX_PRECISION SECUREC_BUFFER_SIZE /* max. # bytes in multibyte char ,see MB_LEN_MAX */ @@ -1583,4 +1585,4 @@ int FlushHilog(void) ret = write(g_hilogFd, buf, strlen(buf) + 1); #endif return ret; -} \ No newline at end of file +} diff --git a/frameworks/mini/BUILD.gn b/frameworks/mini/BUILD.gn index 9ef1a3f5be1e426a0916a669a035d23c669b941f..43d26fada307897b198a70072d090bbdd6722b25 100644 --- a/frameworks/mini/BUILD.gn +++ b/frameworks/mini/BUILD.gn @@ -38,10 +38,10 @@ static_library("hilog_lite") { "hiview_output_log.c", ] defines = [ - "HIVIEW_LOG_FILE_SIZE = $ohos_hiviewdfx_hilog_lite_file_size", - "LOG_LIMIT_DEFAULT = $ohos_hiviewdfx_hilog_lite_limit_level_default", - "LOG_STATIC_CACHE_SIZE = $ohos_hiviewdfx_log_static_cache_size", - "HIVIEW_HILOG_FILE_BUF_SIZE = $ohos_hiviewdfx_hiview_hilog_file_buf_size", + "HIVIEW_LOG_FILE_SIZE=$ohos_hiviewdfx_hilog_lite_file_size", + "LOG_LIMIT_DEFAULT=$ohos_hiviewdfx_hilog_lite_limit_level_default", + "LOG_STATIC_CACHE_SIZE=$ohos_hiviewdfx_log_static_cache_size", + "HIVIEW_HILOG_FILE_BUF_SIZE=$ohos_hiviewdfx_hiview_hilog_file_buf_size", ] if (ohos_hiviewdfx_hilog_lite_disable_cache) { defines += [ "DISABLE_HILOG_CACHE" ] @@ -53,6 +53,12 @@ static_library("hilog_lite") { "//base/hiviewdfx/hiview_lite:hiview_lite_config", ":hilog_lite_config", ] + if (board_toolchain_type == "iccarm") { + cflags = [ + "--diag_suppress", + "Pa039", + ] + } deps = [ "//base/hiviewdfx/hiview_lite" ] } diff --git a/frameworks/mini/hiview_output_log.c b/frameworks/mini/hiview_output_log.c index 1531e785e982e2db79d0e8de0d102cfd24b19b69..2c00b69578251460f3c4aebead9a07b218c47b3d 100644 --- a/frameworks/mini/hiview_output_log.c +++ b/frameworks/mini/hiview_output_log.c @@ -614,7 +614,7 @@ int HiLogFileProcImp(const char* dest, uint8 mode) { FlushLog(TRUE); HIVIEW_MutexLock(g_logFlushInfo.mutex); - int ret = ProcFile(&g_logFile, dest, mode); + int ret = ProcFile(&g_logFile, dest, (FileProcMode)mode); HIVIEW_MutexUnlock(g_logFlushInfo.mutex); return ret; } @@ -627,4 +627,4 @@ void HiLogOutputFileLockImp(void) void HiLogOutputFileUnLockImp(void) { HIVIEW_MutexUnlock(g_outputLogInfo.mutex); -} \ No newline at end of file +}