Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

OCP seems to generate wrong function signature for array arguments

未关闭
#156 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
cpp, python
领域
tooling

调研方向

首先比较 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,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

CadQuery/OCP 的其他 Issue

查看 CadQuery/OCP 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。