Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCP seems to generate wrong function signature for array arguments #156

Open
alexer opened this issue Oct 21, 2024 · 0 comments
Open

OCP seems to generate wrong function signature for array arguments #156

alexer opened this issue Oct 21, 2024 · 0 comments

Comments

@alexer
Copy link

alexer commented Oct 21, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant