Sign in or sign up before continuing. Don't have an account yet? Register now to get started.
Register now
cffi: calling C function fails with package error
(sorry to anyone relying on email gitlab UI confused me. I had to edit the body in after the fact) I'm trying to get [my cffi based bindings to btparse (1)](https://codeberg.org/lou/cl-btparse) working on ECL and have run into a somewhat bizarre error: Calling this function: ```common-lisp (cffi:defcfun ("bt_initialize" bt-initialize) :void) ``` fails with the debugger telling me i'm trying to redefine OR: ```common-lisp Attempt to redefine function OR in locked package. [Condition of type SI::SIMPLE-PACKAGE-ERROR] ``` Ignoring the lock results in two more conditions claiming I'm also redefining AND and WHEN, after that the function executes fine. Even more confusingly I haven't managed to reproduce this issue with any other C function. I cannot make sense of that. This might be more of an cffi-issue but I thought I'd ask here if someone has an idea what could cause this. ecl version: ECL 26.3.27 full macro expansion: ```common-lisp (progn nil (progn (progn (ext:annotate 'bt-initialize 'ext:location '(defun bt-initialize) 'nil) (ext:annotate 'bt-initialize :lambda-list nil 'nil) (si:fset 'bt-initialize #'(ext:lambda-block bt-initialize nil (declare (si::c-global)) (ext:with-backend :bytecodes (si:call-cfun (cffi-sys:%foreign-symbol-pointer "bt_initialize" nil) :void (list) (list)) :c/c++ (si:call-cfun (cffi-sys:%foreign-symbol-pointer "bt_initialize" nil) :void (list) (list)))))) nil 'bt-initialize)) ``` and backtrace: ``` 0: DEBUG-IN-EMACS 1: INVOKE-SLY-DEBUGGER 2: LAMBDA2072 3: CALL-WITH-DEBUGGER-HOOK 4: SLYNK-DEBUGGER-HOOK 5: LAMBDA77 6: BT-INITIALIZE 7: #<bytecompiled-function BYTECODES 0x7f910e620420> 8: LAMBDA103 9: CALL-WITH-RETRY-RESTART 10: LAMBDA100 11: LAMBDA550 12: CALL-WITH-BINDINGS 13: CALL-WITH-LISTENER 14: MREPL-EVAL-1 15: MREPL-EVAL 16: CHANNEL-SEND 17: PROCESS-REQUESTS 18: LAMBDA1001 19: LAMBDA987 20: CALL-WITH-DEBUGGER-HOOK 21: LAMBDA1048 22: LAMBDA1050 23: LAMBDA550 24: CALL-WITH-BINDINGS 25: CALL-WITH-LISTENER 26: LAMBDA983 27: NIL ```
issue