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

Error for unnamed fixed-length array arguments #262

Open
akavel opened this issue Dec 14, 2020 · 0 comments
Open

Error for unnamed fixed-length array arguments #262

akavel opened this issue Dec 14, 2020 · 0 comments

Comments

@akavel
Copy link

akavel commented Dec 14, 2020

I'm getting error like below:

$ cat test.h
void foobar(uint64_t[2]);

$ ~/.nimble/bin/toast -n test.h
# Generated @ 2020-12-14T22:26:39+01:00
# Command line:
#   /home/akavel/.nimble/pkgs/nimterop-0.6.13/nimterop/toast -n test.h

toast.nim(227)           toast
cligen.nim(754)          cligenScope
cligen.nim(672)          dispatchmain
toast.nim(150)           main
toast.nim(30)            process
ast2.nim(1944)           parseNim
ast2.nim(1829)           searchTree
ast2.nim(1809)           processNode
ast2.nim(1749)           addDecl
ast2.nim(1618)           addProc
ast2.nim(660)            newFormalParams
ast2.nim(504)            newIdentDef
comphelp.nim(95)         getNameInfo
getters.nim(219)         getIdentifier
getters.nim(178)         checkIdentifier
assertions.nim(29)       failedAssertImpl
assertions.nim(22)       raiseAssert
fatal.nim(49)            sysFatal
Error: unhandled exception: getters.nim(178, 5) `not name[0].isDigit()` Identifier 'foobar:2' (nskField) starts with a digit '2' which Nim does not allow. Use toast flag '--prefix' or 'cPlugin()' to modify. [AssertionError]

The library I'm trying to link uses the pattern shown above, and I don't know how to workaround this. I checked that non-array unnamed args, as well as array named args, both seem to work separately - but using them together fails:

void foobar(uint64_t zz[2]);  // ok
void foobar(uint64_t);        // ok
void foobar(uint64_t[2]);     // ERROR
akavel added a commit to akavel/nimterop that referenced this issue Dec 18, 2020
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