parapluu / nifty

Erlang NIF Wrapper Generator
http://parapluu.github.io/nifty/
Other
142 stars 29 forks source link

Generated code should not create a function with such a ubiquitous name like 'new'. #58

Closed ten0s closed 7 years ago

ten0s commented 7 years ago
git clone https://github.com/rjmh/q
cd q/
erl
> nifty:compile("q.c", q).
generating...
==> q (compile)
src/q_remote.erl:59: function new/1 already defined
src/q_remote.erl:3: Warning: function new/1 already exported
Compiling src/q_remote.erl failed:
ERROR: compile failed while processing /home/ten0s/tmp/test2/q/q: rebar_abort
{error,compile}

The problem is there's already a function named `new' in q.c

kostis commented 7 years ago

Thanks for reporting this issue. You are of course right that functions with such names should not be created. This is now fixed.