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

Request: more descriptive error for "ccall: wrong number of arguments to C function" #20129

Closed
mcb0035 opened this issue Jan 19, 2017 · 3 comments
Labels
error handling Handling of exceptions by Julia or the user

Comments

@mcb0035
Copy link
Contributor

mcb0035 commented Jan 19, 2017

When ccall is passed an unexpected number of arguments, it would be useful to know which function it is trying to call and what arguments it expects vs. what it gets. For example,

ccall: wrong number of arguments to C function foo
expected (bar, baz), received (bar, bar, baz)

Or something like that. I am looking at ccall.cpp, but if anyone already familiar with the Julia internals can do it better and faster that would be great.

Some ccalls started failing with this error while trying to work around #19774, but without this information it is hard to tell why.

@vtjnash
Copy link
Sponsor Member

vtjnash commented Jan 19, 2017

@thofma
Copy link
Contributor

thofma commented Feb 7, 2017

Is this fixed? I am on

julia> versioninfo()
Julia Version 0.6.0-dev.2634
Commit 754757c* (2017-02-07 15:55 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Core(TM) i7 CPU         860  @ 2.80GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Nehalem)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, nehalem)

and I get

WARNING: ccall: wrong number of arguments to C function in Module

after using Module.

@vtjnash
Copy link
Sponsor Member

vtjnash commented Jun 16, 2017

This error is now thrown as soon as it occurs so the backtrace information should be useful now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error handling Handling of exceptions by Julia or the user
Projects
None yet
Development

No branches or pull requests

4 participants