Nim icon indicating copy to clipboard operation
Nim copied to clipboard

import nativesockets raises error with enabled useNimRtl

Open capocasa opened this issue 7 months ago • 4 comments

Nim Version

Nim Compiler Version 2.0.2 [Linux: amd64] Compiled at 2023-12-15 Copyright (c) 2006-2023 by Andreas Rumpf

git hash: c4c44d10df8a14204a75c34e499def200589cb7c active boot switches: -d:release

Description

# rtltest.nim
import nativesockets

echo "foo"

nim c -d:release -d:useRtl rtltest

Current Output

/home/carlo/.choosenim/toolchains/nim-2.0.2/lib/pure/nativesockets.nim(388, 52) template/generic instantiation from here
/home/carlo/.choosenim/toolchains/nim-2.0.2/lib/pure/nativesockets.nim(453, 18) Error: setSlice(ipStr) do:
  7 .. pred(strAddrLen, 1) can have an unlisted effect: RootEffect

Expected Output

Hint: mm: orc; threads: on; opt: none (DEBUG BUILD, `-d:release` generates faster code)
52820 lines; 0.844s; 71.148MiB peakmem; proj: /home/carlo/rtltest; out: /home/carlo/rtltest [SuccessX]

Known Workarounds

Use -d:useMalloc in both loading program and library and do not use -d:useNimRtl

Additional Information

No response

capocasa avatar Mar 26 '25 12:03 capocasa