`-Wunused-but-set-parameter` is only suppressed in Debug
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 1/5
- 预计耗时
- 1 小时以内
- 新手友好度
- 90/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- cpp
- 领域
- build-system
调研方向
编辑 include/godot_cpp/core/binder_common.hpp:移除 #if defined(DEBUG_ENABLED) 对 #pragma GCC diagnostic push 的 guard,使其与无条件的 pop 匹配。使用 -Wunused-but-set-parameter 和 -Werror 在 Release 中构建 godot-cpp 以确认编译通过。当警告在 Release 中被抑制时完成。
由索引模型根据 Issue 内容生成。
描述
Godot version
4.7.2-stable
godot-cpp version
10.0.0-stable
System information
Windows 11
Issue description
The file in question:
include/godot_cpp/core/binder_common.hpp
The issue is that when godot-cpp is built in Release with GCC with -Wunused-but-set-parameter, this parameter is not suppressed and with -Werror it fails to compile. Also, it seems like an inconsistent check, because #pragma push checks DEBUG_ENABLED, but #pragma pop doesn't.
Suggested fix:
Remove #if defined(DEBUG_ENABLED), so the warning suppression applies in Release too.
// GCC raises "parameter 'p_args' set but not used" when P = {},
// it's not clever enough to treat other P values as making this branch valid.
#if defined(DEBUG_ENABLED) && defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
#endif
...
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif
Steps to reproduce
Build godot-cpp in Release with -Wunused-but-set-parameter
Minimal reproduction project
N/A
- 主要语言
- C++
- 星标
- 2.8k
- 派生
- 825
- 平均合并
- 3 天 23 小时
- 30 天内合并 PR
- 19
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
godotengine/godot-cpp 的其他 Issue
-
Building gdextensions with lto=full warns about serial compilaton可能已有人在做 @marcozee03 于 60 天前认领。 未关闭enhancement topic:buildsystem
难度 2/5 1-3 小时 新手友好度 82/100
godotengine/godot-cpp#2002 ·
维护者通常 2 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 62/100
godotengine/godot-cpp#1969 · 4 条评论 ·
维护者通常 2 天内回复
-
TypedDictionary doesn't support Vector4(i)可能已有人在做 @AddisionS 于 5 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 78/100
godotengine/godot-cpp#1967 · 1 条评论 ·
维护者通常 2 天内回复
-
enhancement topic:buildsystem tracker
难度 4/5 3-5 天 新手友好度 52/100
godotengine/godot-cpp#2064 · 1 个 reaction ·
维护者通常 2 天内回复
-
难度 4/5 3-5 天 新手友好度 50/100
godotengine/godot-cpp#2059 · 4 条评论 ·
维护者通常 2 天内回复
查看 godotengine/godot-cpp 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
eclipse-score/lifecycle#929 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
colbymchenry/codegraph#3223 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
firefox-devtools/profiler#6436 · 1 条评论 ·
维护者通常 1 天内回复
-
The `ufw` decoder requires the kernel's monotonic timestamp, so UFW lines read from journald decode without any field可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复