Skip to content

import nativesockets raises error with enabled useNimRtl #24816

@capocasa

Description

@capocasa

Nim Version

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

git hash: c4c44d1
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions