switch missing default label warning under clang
还没有人认领这个 Issue。
评估
调研方向
阅读 include/boost/function/function_base.hpp 中第 105 行附近的 enum 和第 147 行的 switch,然后使用 clang 19.1.7 及报告中的警告标志重现该警告。在选择抑制还是添加 default case 之前,先查看项目指南;当报告的 -Wswitch-default 错误不再出现且没有引入非预期的行为变化时,即可认为该 issue 已完成。
由索引模型根据 Issue 内容生成。
描述
When compiling under clang 19.1.7 with werror and a number of other flags (we run with most warnings enabled), the line https://github.com/boostorg/function/blob/develop/include/boost/function/function_base.hpp#L147 is flagged with error: switch missing default label [-Werror,-Wswitch-default]. Given this is based on the enum at https://github.com/boostorg/function/blob/f6b538dbed2e3047dcbd09eb3f5c7f1ffa90d0a9/include/boost/function/function_base.hpp#L105 and all cases are handled a pr has not been provided at this time. I see two approaches, one is doing a compiler warning suppression and the other is adding the default label with a throw or similar as it should be an unreachable place based on the current code. The suppression seems like the simpler answer but may cause a future update to the enum to be missed here while the throw would prevent that at the cost of potentially changing behavior if something is flagged nothrow. Happy to submit a PR but would need guidance no how it should be approached here.
Env:
Alma 9.6
Boost 1.88.0 via cmake
clang 19.1.7
- 主要语言
- C++
- 星标
- 26
- 派生
- 58
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 65/100
duckdb/duckdb-wasm#2258 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
objectionary/eo-graphs#75 ·
-
Coarray integration tests carry no LABELS, so run_tests.py silently skips them under every backend 未关闭coarray
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 75/100
FISCO-BCOS/FISCO-BCOS#5642 ·