odin-http icon indicating copy to clipboard operation
odin-http copied to clipboard

`@(init)` Procedures Must Be `"contextless"`

Open dozn opened this issue 3 months ago • 3 comments

.../libs/odin-http/server.odin:64:1: Error: @(init) procedures must be declared as "contextless" 
        server_opts_init :: proc() { 
        ^ 
 
.../libs/odin-http/status.odin:81:1: Error: @(init) procedures must be declared as "contextless" 
        status_strings_init :: proc() { 
        ^ 

Odin: dev-2025-08:8df69c95c OS: Windows 11 Professional (version: 23H2), build 22631.5624 CPU: AMD Ryzen 7 7700 8-Core Processor RAM: 61033 MiB Backend: LLVM 20.1.0

dozn avatar Aug 10 '25 23:08 dozn

In case anyone wants a temporary solution for their own projects, the latest version of the compiler includes #+feature global-context which you can place at the top of status.odin and server.odin (on Linux/macOS) to revert to the old behaviour, for now.

dozn avatar Aug 14 '25 15:08 dozn

Also for openssl/openssl.odin. Would using a "context = runtime.default_context()" and declaring the init functions as contextless be a more appropriate fix?

jackmay942149 avatar Oct 14 '25 08:10 jackmay942149

Have this same problem and above fixes dont seem to work

SyntaxWarrior avatar Oct 17 '25 19:10 SyntaxWarrior