OCP seems to generate wrong function signature for array arguments
还没有人认领这个 Issue。
评估
调研方向
首先比较 OCCT HLRAlgo::InitMinMax 声明与生成的 OCP.HLRAlgo.HLRAlgo.InitMinMax_s 签名。检查数组参数的绑定生成路径,并使用此入口点复现崩溃。当数组参数得到正确支持,或者生成的函数安全地拒绝数组参数而不是接受无效签名时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
OCP seems to generate wrong function signature for array arguments.
For example, OCCT has:
void HLRAlgo::InitMinMax (const Standard_Real Big, Standard_Real Min[16], Standard_Real Max[16])
But OCP lists OCP.HLRAlgo.HLRAlgo.InitMinMax_s() as:
TypeError: InitMinMax_s(): incompatible function arguments. The following argument types are supported:
1. (Big: float, Min: float, Max: float) -> None
Of course, if you actually try calling it with just float, it crashes:
>>> from OCP.HLRAlgo import HLRAlgo
>>> HLRAlgo.InitMinMax_s(0., 0., 0.)
*** stack smashing detected ***: terminated
Aborted
I'm not sure if there are any array-argument-taking functions which are likely to be used by anyone (I was only trying to use the MinMax things in HLR to verify I've understood some code correctly, not for actual work); Grepping does indicate that they are used at least in a few other places, but I don't know if those are things that anyone is likely to want to use.
What I'm saying is, I'm not sure if this is "worth" fixing properly (ie. adding support for array arguments), and how hard that would be to do - but if it's decided that it's not worth fixing properly, maybe the functions could at least be made to raise an error when called, instead of actually allowing the call with the wrong signature to go through and crash the program?
- 主要语言
- C++
- 星标
- 207
- 派生
- 51
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
CadQuery/OCP 的其他 Issue
-
Generation steps fails when OPENGL_INCLUDE_DIRS is a list可能已有人在做 @adam-urbanczyk 于 78 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 4/5 3-5 天 新手友好度 48/100
-
难度 4/5 3-5 天 新手友好度 35/100
-
难度 3/5 1-2 天 新手友好度 68/100
-
难度 3/5 1-2 天 新手友好度 58/100
相似的 Issue
-
[Docs] CONTRIBUTING still says FreeType 2.14.3 and TabLabel.h says ImGui 1.92.9b after the bumps可能已有人在做 @mgradwohl 今天认领。 未关闭agent:WSL documentation LOW
难度 1/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
finalburnneo/FBNeo#2820 · 1 条评论 ·
维护者通常 1 天内回复
-
area/ysql kind/enhancement priority/medium status/awaiting-triage
难度 2/5 1-3 小时 新手友好度 73/100
yugabyte/yugabyte-db#35578 ·
维护者通常 1 天内回复
-
cudf-polars feature request
难度 2/5 1-3 小时 新手友好度 77/100
维护者通常 2 天内回复
-
(S1 - Need confirmation)
难度 2/5 1-3 小时 新手友好度 68/100
CleverRaven/Cataclysm-DDA#89212 ·
维护者通常 1 天内回复