Fix return types of three module API declarations to match definitions (#4676)
`ValkeyModule_FreeModuleUser`, `ValkeyModule_ACLAddLogEntry` and `ValkeyModule_ACLAddLogEntryByUserName` are declared in valkeymodule.h as returning void, but the implementations (`VM_FreeModuleUser`, `VM_ACLAddLogEntry`, `VM_ACLAddLogEntryByUserName`) return int, and the latter two document `VALKEYMODULE_OK` / `VALKEYMODULE_ERR`. Modules calling them through the API table therefore call an int function via a void function pointer, which is undefined behavior in C. On x86-64 and arm64 the discarded return register makes it harmless in practice; on a target with strict indirect-call signature checking (WebAssembly) the call traps. Declare them as int to match the implementation. Existing modules that ignore the return value are unaffected; modules can now check the result of the ACL log calls as documented. Also document that `FreeModuleUser` returns `VALKEYMODULE_OK`. Found by compiling the server with Emscripten, where `redis.acl_check_cmd` in a Lua script (which calls `FreeModuleUser` through the API table) trapped with 'null function or function signature mismatch'. Signed-off-by: Rain Valentine <rsg000@gmail.com>
R
Rain Valentine committed
d6415e766b8d0273d7f353eacf4791ed0d4ef1a5
Parent: 66f9618
Committed by GitHub <noreply@github.com>
on 9/16/2026, 2:41:42 AM