1 Star 0 Fork 76

mds.lanruo/dpdk

forked from src-openEuler/dpdk 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0330-examples-performance-thread-fix-build-with-GCC-12.patch 2.31 KB
一键复制 编辑 原始数据 按行查看 历史
jinag12 提交于 2023-07-12 11:47 . fix build with GCC 12
From 125a65cb03f845d1b6d5f7078670aa1a49d62513 Mon Sep 17 00:00:00 2001
From: Kevin Traynor <ktraynor@redhat.com>
Date: Wed, 24 Aug 2022 10:17:07 +0100
Subject: [PATCH] examples/performance-thread: fix build with GCC 12
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[1/2] Compiling C object examples/dpdk-pthrea...
formance-thread_pthread_shim_pthread_shim.c.o
../examples/performance-thread/pthread_shim/pthread_shim.c:
In function ‘pthread_setspecific’:
../examples/performance-thread/pthread_shim/pthread_shim.c:592:27:
warning: ‘data’ may be used uninitialized [-Wmaybe-uninitialized]
592 | int rv = lthread_setspecific((unsigned int)key, data);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../examples/performance-thread/pthread_shim/pthread_shim.c:589:56:
note: accessing argument 2 of a function declared with attribute
‘access (none, 2)’
589 | int pthread_setspecific(pthread_key_t key, const void *data)
| ~~~~~~~~~~~~^~~~
This is a false positive as pthread_setspecific() does not read from
the (const void *) so we can squash the warning.
performance-thread example is already removed from DPDK main branch.
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
---
examples/performance-thread/pthread_shim/pthread_shim.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/examples/performance-thread/pthread_shim/pthread_shim.c b/examples/performance-thread/pthread_shim/pthread_shim.c
index bbc076584b..a44cb8244d 100644
--- a/examples/performance-thread/pthread_shim/pthread_shim.c
+++ b/examples/performance-thread/pthread_shim/pthread_shim.c
@@ -586,6 +586,11 @@ pthread_t pthread_self(void)
return _sys_pthread_funcs.f_pthread_self();
}
+#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 120000)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
+#endif
+
int pthread_setspecific(pthread_key_t key, const void *data)
{
if (override) {
@@ -595,6 +600,10 @@ int pthread_setspecific(pthread_key_t key, const void *data)
return _sys_pthread_funcs.f_pthread_setspecific(key, data);
}
+#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 120000)
+#pragma GCC diagnostic pop
+#endif
+
int pthread_spin_init(pthread_spinlock_t *a, int b)
{
NOT_IMPLEMENTED;
--
2.23.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mdslanruo/dpdk.git
git@gitee.com:mdslanruo/dpdk.git
mdslanruo
dpdk
dpdk
master

搜索帮助