8 Star 0 Fork 9

src-openEuler/hiviewdfx_hilog

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0006-feat-for-embedded-fix-unused-errors.patch 1.74 KB
一键复制 编辑 原始数据 按行查看 历史
s_c_c 提交于 2024-03-12 16:27 +08:00 . Fix compile errors for embedded
From 874b94e548e6a66264d5fa5b35c272a5b64aab35 Mon Sep 17 00:00:00 2001
From: s_c_c <shichuchao@huawei.com>
Date: Tue, 12 Mar 2024 16:11:06 +0800
Subject: [PATCH 2/2] feat for embedded fix unused errors
---
frameworks/libhilog/hilog.cpp | 3 +--
frameworks/libhilog/utils/log_utils.cpp | 3 ++-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/frameworks/libhilog/hilog.cpp b/frameworks/libhilog/hilog.cpp
index 8da82c5..b42f601 100644
--- a/frameworks/libhilog/hilog.cpp
+++ b/frameworks/libhilog/hilog.cpp
@@ -76,7 +76,6 @@ int HiLogPrintArgs(const LogType type, const LogLevel level, const unsigned int
char buf[MAX_LOG_LEN] = {0};
char *logBuf = buf;
int traceBufLen = 0;
- int ret;
bool priv = false;
#ifdef __clang__
@@ -88,7 +87,7 @@ int HiLogPrintArgs(const LogType type, const LogLevel level, const unsigned int
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
#endif
- ret = vsnprintfp_s(logBuf, MAX_LOG_LEN - traceBufLen, MAX_LOG_LEN - traceBufLen - 1, priv, fmt, ap);
+ (void)vsnprintfp_s(logBuf, MAX_LOG_LEN - traceBufLen, MAX_LOG_LEN - traceBufLen - 1, priv, fmt, ap);
#ifdef __clang__
#pragma clang diagnostic pop
#elif __GNUC__
diff --git a/frameworks/libhilog/utils/log_utils.cpp b/frameworks/libhilog/utils/log_utils.cpp
index af130c4..0ff618f 100644
--- a/frameworks/libhilog/utils/log_utils.cpp
+++ b/frameworks/libhilog/utils/log_utils.cpp
@@ -494,7 +494,8 @@ void PrintErrorno(int err)
constexpr int bufSize = 256;
char buf[bufSize] = { 0 };
#ifndef __WINDOWS__
- (void)strerror_r(err, buf, bufSize);
+ char *ret = strerror_r(err, buf, bufSize);
+ (void)ret;
#else
(void)strerror_s(buf, bufSize, err);
#endif
--
2.20.1 (Apple Git-117)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/hiviewdfx_hilog.git
git@gitee.com:src-openeuler/hiviewdfx_hilog.git
src-openeuler
hiviewdfx_hilog
hiviewdfx_hilog
master

搜索帮助