koka-lang / koka

Koka language compiler and interpreter
http://koka-lang.org
Other
3.16k stars 153 forks source link

warning: macro 'ATOMIC_VAR_INIT' has been marked as deprecated [-Wdeprecated-pragma] #307

Open tom-sherman opened 1 year ago

tom-sherman commented 1 year ago

I receive these warnings on m1 mac when compiling

fun main()
  println("Hello World")
> koka test.kk
compile: test.kk
loading: std/core
loading: std/core/types
loading: std/core/hnd
check  : test
In file included from .koka/v2.4.0/clang-debug/test.c:2:
In file included from .koka/v2.4.0/clang-debug/test.h:5:
/opt/homebrew/Cellar/koka/2.4.0/share/koka/v2.4.0/kklib/include/kklib.h:134:24: warning: macro 'ATOMIC_VAR_INIT' has been marked as deprecated [-Wdeprecated-pragma]
  kk_header_t header = KK_HEADER((uint8_t)scan_fsize, (uint16_t)tag);
                       ^
/opt/homebrew/Cellar/koka/2.4.0/share/koka/v2.4.0/kklib/include/kklib.h:126:65: note: expanded from macro 'KK_HEADER'
#define KK_HEADER(scan_fsize,tag)         { scan_fsize, 0, tag, ATOMIC_VAR_INIT(0) }                // start with refcount of 0
                                                                ^
/opt/homebrew/Cellar/llvm/14.0.6_1/lib/clang/14.0.6/include/stdatomic.h:50:41: note: macro marked 'deprecated' here
#pragma clang deprecated(ATOMIC_VAR_INIT)
                                        ^
In file included from .koka/v2.4.0/clang-debug/test.c:2:
In file included from .koka/v2.4.0/clang-debug/test.h:7:
.koka/v2.4.0/clang-debug/std_core.h:2201:3: warning: macro 'ATOMIC_VAR_INIT' has been marked as deprecated [-Wdeprecated-pragma]
  kk_define_string_literal(, _s20493, 1, "\'")
  ^
/opt/homebrew/Cellar/koka/2.4.0/share/koka/v2.4.0/kklib/include/kklib/string.h:121:11: note: expanded from macro 'kk_define_string_literal'
    { { { KK_HEADER_STATIC(0,KK_TAG_STRING) } }, len, chars }; \
          ^
/opt/homebrew/Cellar/koka/2.4.0/share/koka/v2.4.0/kklib/include/kklib.h:127:65: note: expanded from macro 'KK_HEADER_STATIC'
#define KK_HEADER_STATIC(scan_fsize,tag)  { scan_fsize, 0, tag, ATOMIC_VAR_INIT(KK_U32(0x80000000)) } // start with a stuck refcount (RC_STUCK)
                                                                ^
/opt/homebrew/Cellar/llvm/14.0.6_1/lib/clang/14.0.6/include/stdatomic.h:50:41: note: macro marked 'deprecated' here
#pragma clang deprecated(ATOMIC_VAR_INIT)
                                        ^
In file included from .koka/v2.4.0/clang-debug/test.c:2:
In file included from .koka/v2.4.0/clang-debug/test.h:7:
.koka/v2.4.0/clang-debug/std_core.h:2206:3: warning: macro 'ATOMIC_VAR_INIT' has been marked as deprecated [-Wdeprecated-pragma]
  kk_define_string_literal(, _s20497, 1, "\'")
  ^
/opt/homebrew/Cellar/koka/2.4.0/share/koka/v2.4.0/kklib/include/kklib/string.h:121:11: note: expanded from macro 'kk_define_string_literal'
    { { { KK_HEADER_STATIC(0,KK_TAG_STRING) } }, len, chars }; \
          ^
/opt/homebrew/Cellar/koka/2.4.0/share/koka/v2.4.0/kklib/include/kklib.h:127:65: note: expanded from macro 'KK_HEADER_STATIC'
#define KK_HEADER_STATIC(scan_fsize,tag)  { scan_fsize, 0, tag, ATOMIC_VAR_INIT(KK_U32(0x80000000)) } // start with a stuck refcount (RC_STUCK)
                                                                ^
/opt/homebrew/Cellar/llvm/14.0.6_1/lib/clang/14.0.6/include/stdatomic.h:50:41: note: macro marked 'deprecated' here
#pragma clang deprecated(ATOMIC_VAR_INIT)
                                        ^
In file included from .koka/v2.4.0/clang-debug/test.c:2:
In file included from .koka/v2.4.0/clang-debug/test.h:7:
.koka/v2.4.0/clang-debug/std_core.h:2220:5: warning: macro 'ATOMIC_VAR_INIT' has been marked as deprecated [-Wdeprecated-pragma]
    kk_define_string_literal(, _s20516, 4, "True")
    ^
/opt/homebrew/Cellar/koka/2.4.0/share/koka/v2.4.0/kklib/include/kklib/string.h:121:11: note: expanded from macro 'kk_define_string_literal'
    { { { KK_HEADER_STATIC(0,KK_TAG_STRING) } }, len, chars }; \
          ^
/opt/homebrew/Cellar/koka/2.4.0/share/koka/v2.4.0/kklib/include/kklib.h:127:65: note: expanded from macro 'KK_HEADER_STATIC'
#define KK_HEADER_STATIC(scan_fsize,tag)  { scan_fsize, 0, tag, ATOMIC_VAR_INIT(KK_U32(0x80000000)) } // start with a stuck refcount (RC_STUCK)
                                                                ^
/opt/homebrew/Cellar/llvm/14.0.6_1/lib/clang/14.0.6/include/stdatomic.h:50:41: note: macro marked 'deprecated' here
#pragma clang deprecated(ATOMIC_VAR_INIT)
                                        ^
In file included from .koka/v2.4.0/clang-debug/test.c:2:
In file included from .koka/v2.4.0/clang-debug/test.h:7:
.koka/v2.4.0/clang-debug/std_core.h:2224:5: warning: macro 'ATOMIC_VAR_INIT' has been marked as deprecated [-Wdeprecated-pragma]
    kk_define_string_literal(, _s20517, 5, "False")
    ^
/opt/homebrew/Cellar/koka/2.4.0/share/koka/v2.4.0/kklib/include/kklib/string.h:121:11: note: expanded from macro 'kk_define_string_literal'
    { { { KK_HEADER_STATIC(0,KK_TAG_STRING) } }, len, chars }; \
          ^
/opt/homebrew/Cellar/koka/2.4.0/share/koka/v2.4.0/kklib/include/kklib.h:127:65: note: expanded from macro 'KK_HEADER_STATIC'
#define KK_HEADER_STATIC(scan_fsize,tag)  { scan_fsize, 0, tag, ATOMIC_VAR_INIT(KK_U32(0x80000000)) } // start with a stuck refcount (RC_STUCK)
                                                                ^
/opt/homebrew/Cellar/llvm/14.0.6_1/lib/clang/14.0.6/include/stdatomic.h:50:41: note: macro marked 'deprecated' here
#pragma clang deprecated(ATOMIC_VAR_INIT)
                                        ^
In file included from .koka/v2.4.0/clang-debug/test.c:2:
In file included from .koka/v2.4.0/clang-debug/test.h:7:
.koka/v2.4.0/clang-debug/std_core.h:2232:3: warning: macro 'ATOMIC_VAR_INIT' has been marked as deprecated [-Wdeprecated-pragma]
  kk_define_string_literal(, _s20518, 2, "()")
  ^
/opt/homebrew/Cellar/koka/2.4.0/share/koka/v2.4.0/kklib/include/kklib/string.h:121:11: note: expanded from macro 'kk_define_string_literal'
    { { { KK_HEADER_STATIC(0,KK_TAG_STRING) } }, len, chars }; \
          ^
/opt/homebrew/Cellar/koka/2.4.0/share/koka/v2.4.0/kklib/include/kklib.h:127:65: note: expanded from macro 'KK_HEADER_STATIC'
#define KK_HEADER_STATIC(scan_fsize,tag)  { scan_fsize, 0, tag, ATOMIC_VAR_INIT(KK_U32(0x80000000)) } // start with a stuck refcount (RC_STUCK)
                                                                ^
/opt/homebrew/Cellar/llvm/14.0.6_1/lib/clang/14.0.6/include/stdatomic.h:50:41: note: macro marked 'deprecated' here
#pragma clang deprecated(ATOMIC_VAR_INIT)
                                        ^
In file included from .koka/v2.4.0/clang-debug/test.c:2:
In file included from .koka/v2.4.0/clang-debug/test.h:7:
.koka/v2.4.0/clang-debug/std_core.h:2250:3: warning: macro 'ATOMIC_VAR_INIT' has been marked as deprecated [-Wdeprecated-pragma]
  kk_define_static_function(_fself, kk_std_core_show_fun20520_7, _ctx)
  ^
/opt/homebrew/Cellar/koka/2.4.0/share/koka/v2.4.0/kklib/include/kklib.h:1120:52: note: expanded from macro 'kk_define_static_function'
  static struct kk_function_s _static_##name = { { KK_HEADER_STATIC(0,KK_TAG_FUNCTION) }, { ~KK_UP(0) } }; /* must be box_null */ \
                                                   ^
/opt/homebrew/Cellar/koka/2.4.0/share/koka/v2.4.0/kklib/include/kklib.h:127:65: note: expanded from macro 'KK_HEADER_STATIC'
#define KK_HEADER_STATIC(scan_fsize,tag)  { scan_fsize, 0, tag, ATOMIC_VAR_INIT(KK_U32(0x80000000)) } // start with a stuck refcount (RC_STUCK)
                                                                ^
/opt/homebrew/Cellar/llvm/14.0.6_1/lib/clang/14.0.6/include/stdatomic.h:50:41: note: macro marked 'deprecated' here
#pragma clang deprecated(ATOMIC_VAR_INIT)
                                        ^
In file included from .koka/v2.4.0/clang-debug/test.c:2:
In file included from .koka/v2.4.0/clang-debug/test.h:7:
.koka/v2.4.0/clang-debug/std_core.h:2266:3: warning: macro 'ATOMIC_VAR_INIT' has been marked as deprecated [-Wdeprecated-pragma]
  kk_define_static_function(_fself, kk_std_core_show_fun20522_8, _ctx)
  ^
/opt/homebrew/Cellar/koka/2.4.0/share/koka/v2.4.0/kklib/include/kklib.h:1120:52: note: expanded from macro 'kk_define_static_function'
  static struct kk_function_s _static_##name = { { KK_HEADER_STATIC(0,KK_TAG_FUNCTION) }, { ~KK_UP(0) } }; /* must be box_null */ \
                                                   ^
/opt/homebrew/Cellar/koka/2.4.0/share/koka/v2.4.0/kklib/include/kklib.h:127:65: note: expanded from macro 'KK_HEADER_STATIC'
#define KK_HEADER_STATIC(scan_fsize,tag)  { scan_fsize, 0, tag, ATOMIC_VAR_INIT(KK_U32(0x80000000)) } // start with a stuck refcount (RC_STUCK)
                                                                ^
/opt/homebrew/Cellar/llvm/14.0.6_1/lib/clang/14.0.6/include/stdatomic.h:50:41: note: macro marked 'deprecated' here
#pragma clang deprecated(ATOMIC_VAR_INIT)
                                        ^
In file included from .koka/v2.4.0/clang-debug/test.c:2:
In file included from .koka/v2.4.0/clang-debug/test.h:7:
.koka/v2.4.0/clang-debug/std_core.h:2282:3: warning: macro 'ATOMIC_VAR_INIT' has been marked as deprecated [-Wdeprecated-pragma]
  kk_define_static_function(_fself, kk_std_core_show_fun20524_9, _ctx)
  ^
/opt/homebrew/Cellar/koka/2.4.0/share/koka/v2.4.0/kklib/include/kklib.h:1120:52: note: expanded from macro 'kk_define_static_function'
  static struct kk_function_s _static_##name = { { KK_HEADER_STATIC(0,KK_TAG_FUNCTION) }, { ~KK_UP(0) } }; /* must be box_null */ \
                                                   ^
/opt/homebrew/Cellar/koka/2.4.0/share/koka/v2.4.0/kklib/include/kklib.h:127:65: note: expanded from macro 'KK_HEADER_STATIC'
#define KK_HEADER_STATIC(scan_fsize,tag)  { scan_fsize, 0, tag, ATOMIC_VAR_INIT(KK_U32(0x80000000)) } // start with a stuck refcount (RC_STUCK)
                                                                ^
/opt/homebrew/Cellar/llvm/14.0.6_1/lib/clang/14.0.6/include/stdatomic.h:50:41: note: macro marked 'deprecated' here
#pragma clang deprecated(ATOMIC_VAR_INIT)
                                        ^
In file included from .koka/v2.4.0/clang-debug/test.c:2:
In file included from .koka/v2.4.0/clang-debug/test.h:7:
.koka/v2.4.0/clang-debug/std_core.h:2316:5: warning: macro 'ATOMIC_VAR_INIT' has been marked as deprecated [-Wdeprecated-pragma]
    kk_define_string_literal(, _s20529, 4, "True")
    ^
/opt/homebrew/Cellar/koka/2.4.0/share/koka/v2.4.0/kklib/include/kklib/string.h:121:11: note: expanded from macro 'kk_define_string_literal'
    { { { KK_HEADER_STATIC(0,KK_TAG_STRING) } }, len, chars }; \
          ^
/opt/homebrew/Cellar/koka/2.4.0/share/koka/v2.4.0/kklib/include/kklib.h:127:65: note: expanded from macro 'KK_HEADER_STATIC'
#define KK_HEADER_STATIC(scan_fsize,tag)  { scan_fsize, 0, tag, ATOMIC_VAR_INIT(KK_U32(0x80000000)) } // start with a stuck refcount (RC_STUCK)
                                                                ^
/opt/homebrew/Cellar/llvm/14.0.6_1/lib/clang/14.0.6/include/stdatomic.h:50:41: note: macro marked 'deprecated' here
#pragma clang deprecated(ATOMIC_VAR_INIT)
                                        ^
In file included from .koka/v2.4.0/clang-debug/test.c:2:
In file included from .koka/v2.4.0/clang-debug/test.h:7:
.koka/v2.4.0/clang-debug/std_core.h:2320:5: warning: macro 'ATOMIC_VAR_INIT' has been marked as deprecated [-Wdeprecated-pragma]
    kk_define_string_literal(, _s20530, 5, "False")
    ^
/opt/homebrew/Cellar/koka/2.4.0/share/koka/v2.4.0/kklib/include/kklib/string.h:121:11: note: expanded from macro 'kk_define_string_literal'
    { { { KK_HEADER_STATIC(0,KK_TAG_STRING) } }, len, chars }; \
          ^
/opt/homebrew/Cellar/koka/2.4.0/share/koka/v2.4.0/kklib/include/kklib.h:127:65: note: expanded from macro 'KK_HEADER_STATIC'
#define KK_HEADER_STATIC(scan_fsize,tag)  { scan_fsize, 0, tag, ATOMIC_VAR_INIT(KK_U32(0x80000000)) } // start with a stuck refcount (RC_STUCK)
                                                                ^
/opt/homebrew/Cellar/llvm/14.0.6_1/lib/clang/14.0.6/include/stdatomic.h:50:41: note: macro marked 'deprecated' here
#pragma clang deprecated(ATOMIC_VAR_INIT)
                                        ^
In file included from .koka/v2.4.0/clang-debug/test.c:2:
In file included from .koka/v2.4.0/clang-debug/test.h:7:
.koka/v2.4.0/clang-debug/std_core.h:2337:3: warning: macro 'ATOMIC_VAR_INIT' has been marked as deprecated [-Wdeprecated-pragma]
  kk_define_string_literal(, _s20533, 2, "()")
  ^
/opt/homebrew/Cellar/koka/2.4.0/share/koka/v2.4.0/kklib/include/kklib/string.h:121:11: note: expanded from macro 'kk_define_string_literal'
    { { { KK_HEADER_STATIC(0,KK_TAG_STRING) } }, len, chars }; \
          ^
/opt/homebrew/Cellar/koka/2.4.0/share/koka/v2.4.0/kklib/include/kklib.h:127:65: note: expanded from macro 'KK_HEADER_STATIC'
#define KK_HEADER_STATIC(scan_fsize,tag)  { scan_fsize, 0, tag, ATOMIC_VAR_INIT(KK_U32(0x80000000)) } // start with a stuck refcount (RC_STUCK)
                                                                ^
/opt/homebrew/Cellar/llvm/14.0.6_1/lib/clang/14.0.6/include/stdatomic.h:50:41: note: macro marked 'deprecated' here
#pragma clang deprecated(ATOMIC_VAR_INIT)
                                        ^
In file included from .koka/v2.4.0/clang-debug/test.c:2:
In file included from .koka/v2.4.0/clang-debug/test.h:7:
.koka/v2.4.0/clang-debug/std_core.h:2780:5: warning: macro 'ATOMIC_VAR_INIT' has been marked as deprecated [-Wdeprecated-pragma]
    kk_define_string_literal(, _s20893, 4, "True")
    ^
/opt/homebrew/Cellar/koka/2.4.0/share/koka/v2.4.0/kklib/include/kklib/string.h:121:11: note: expanded from macro 'kk_define_string_literal'
    { { { KK_HEADER_STATIC(0,KK_TAG_STRING) } }, len, chars }; \
          ^
/opt/homebrew/Cellar/koka/2.4.0/share/koka/v2.4.0/kklib/include/kklib.h:127:65: note: expanded from macro 'KK_HEADER_STATIC'
#define KK_HEADER_STATIC(scan_fsize,tag)  { scan_fsize, 0, tag, ATOMIC_VAR_INIT(KK_U32(0x80000000)) } // start with a stuck refcount (RC_STUCK)
                                                                ^
/opt/homebrew/Cellar/llvm/14.0.6_1/lib/clang/14.0.6/include/stdatomic.h:50:41: note: macro marked 'deprecated' here
#pragma clang deprecated(ATOMIC_VAR_INIT)
                                        ^
In file included from .koka/v2.4.0/clang-debug/test.c:2:
In file included from .koka/v2.4.0/clang-debug/test.h:7:
.koka/v2.4.0/clang-debug/std_core.h:2784:5: warning: macro 'ATOMIC_VAR_INIT' has been marked as deprecated [-Wdeprecated-pragma]
    kk_define_string_literal(, _s20894, 5, "False")
    ^
/opt/homebrew/Cellar/koka/2.4.0/share/koka/v2.4.0/kklib/include/kklib/string.h:121:11: note: expanded from macro 'kk_define_string_literal'
    { { { KK_HEADER_STATIC(0,KK_TAG_STRING) } }, len, chars }; \
          ^
/opt/homebrew/Cellar/koka/2.4.0/share/koka/v2.4.0/kklib/include/kklib.h:127:65: note: expanded from macro 'KK_HEADER_STATIC'
#define KK_HEADER_STATIC(scan_fsize,tag)  { scan_fsize, 0, tag, ATOMIC_VAR_INIT(KK_U32(0x80000000)) } // start with a stuck refcount (RC_STUCK)
                                                                ^
/opt/homebrew/Cellar/llvm/14.0.6_1/lib/clang/14.0.6/include/stdatomic.h:50:41: note: macro marked 'deprecated' here
#pragma clang deprecated(ATOMIC_VAR_INIT)
                                        ^
In file included from .koka/v2.4.0/clang-debug/test.c:2:
In file included from .koka/v2.4.0/clang-debug/test.h:7:
.koka/v2.4.0/clang-debug/std_core.h:2801:3: warning: macro 'ATOMIC_VAR_INIT' has been marked as deprecated [-Wdeprecated-pragma]
  kk_define_string_literal(, _s20897, 2, "()")
  ^
/opt/homebrew/Cellar/koka/2.4.0/share/koka/v2.4.0/kklib/include/kklib/string.h:121:11: note: expanded from macro 'kk_define_string_literal'
    { { { KK_HEADER_STATIC(0,KK_TAG_STRING) } }, len, chars }; \
          ^
/opt/homebrew/Cellar/koka/2.4.0/share/koka/v2.4.0/kklib/include/kklib.h:127:65: note: expanded from macro 'KK_HEADER_STATIC'
#define KK_HEADER_STATIC(scan_fsize,tag)  { scan_fsize, 0, tag, ATOMIC_VAR_INIT(KK_U32(0x80000000)) } // start with a stuck refcount (RC_STUCK)
                                                                ^
/opt/homebrew/Cellar/llvm/14.0.6_1/lib/clang/14.0.6/include/stdatomic.h:50:41: note: macro marked 'deprecated' here
#pragma clang deprecated(ATOMIC_VAR_INIT)
                                        ^
In file included from .koka/v2.4.0/clang-debug/test.c:2:
In file included from .koka/v2.4.0/clang-debug/test.h:7:
.koka/v2.4.0/clang-debug/std_core.h:3000:3: warning: macro 'ATOMIC_VAR_INIT' has been marked as deprecated [-Wdeprecated-pragma]
  kk_define_string_literal(, _s20953, 1, "\n")
  ^
/opt/homebrew/Cellar/koka/2.4.0/share/koka/v2.4.0/kklib/include/kklib/string.h:121:11: note: expanded from macro 'kk_define_string_literal'
    { { { KK_HEADER_STATIC(0,KK_TAG_STRING) } }, len, chars }; \
          ^
/opt/homebrew/Cellar/koka/2.4.0/share/koka/v2.4.0/kklib/include/kklib.h:127:65: note: expanded from macro 'KK_HEADER_STATIC'
#define KK_HEADER_STATIC(scan_fsize,tag)  { scan_fsize, 0, tag, ATOMIC_VAR_INIT(KK_U32(0x80000000)) } // start with a stuck refcount (RC_STUCK)
                                                                ^
/opt/homebrew/Cellar/llvm/14.0.6_1/lib/clang/14.0.6/include/stdatomic.h:50:41: note: macro marked 'deprecated' here
#pragma clang deprecated(ATOMIC_VAR_INIT)
                                        ^
In file included from .koka/v2.4.0/clang-debug/test.c:2:
.koka/v2.4.0/clang-debug/test.h:15:3: warning: macro 'ATOMIC_VAR_INIT' has been marked as deprecated [-Wdeprecated-pragma]
  kk_define_string_literal(, _s28, 11, "Hello World")
  ^
/opt/homebrew/Cellar/koka/2.4.0/share/koka/v2.4.0/kklib/include/kklib/string.h:121:11: note: expanded from macro 'kk_define_string_literal'
    { { { KK_HEADER_STATIC(0,KK_TAG_STRING) } }, len, chars }; \
          ^
/opt/homebrew/Cellar/koka/2.4.0/share/koka/v2.4.0/kklib/include/kklib.h:127:65: note: expanded from macro 'KK_HEADER_STATIC'
#define KK_HEADER_STATIC(scan_fsize,tag)  { scan_fsize, 0, tag, ATOMIC_VAR_INIT(KK_U32(0x80000000)) } // start with a stuck refcount (RC_STUCK)
                                                                ^
/opt/homebrew/Cellar/llvm/14.0.6_1/lib/clang/14.0.6/include/stdatomic.h:50:41: note: macro marked 'deprecated' here
#pragma clang deprecated(ATOMIC_VAR_INIT)
                                        ^
17 warnings generated.
linking: test
created: .koka/v2.4.0/clang-debug/test

Version:

Koka 2.4.0, 00:44:42 Feb 19 2022 (ghc release version)
version: 2.4.0
bin    : /opt/homebrew/Cellar/koka/2.4.0/bin
lib    : /opt/homebrew/Cellar/koka/2.4.0/lib/koka/v2.4.0
share  : /opt/homebrew/Cellar/koka/2.4.0/share/koka/v2.4.0
output : .koka/v2.4.0/clang-debug
cc     : /opt/homebrew/opt/llvm/bin/clang
tom-sherman commented 1 year ago

Running brew remove llvm removes the warnings, this sets cc back to /usr/bin/clang.

So I guess the warnings only exist on the clang version that comes with llvm, but not the one that's bundled with my version of macos (12.6).

solidsnack commented 1 year ago

This has to do with the long run deprecation of the ATOMIC_VAR_INIT macro. At present, it shows up in only two places in Koka (kklib.h:126 and kklib.h:127):

#define KK_HEADER(scan_fsize,tag)         { scan_fsize, 0, tag, ATOMIC_VAR_INIT(0) }                // start with refcount of 0
#define KK_HEADER_STATIC(scan_fsize,tag)  { scan_fsize, 0, tag, ATOMIC_VAR_INIT(KK_U32(0x80000000)) } // start with a stuck refcount (RC_STUCK)

Now it may be that the effect of newer C standards is to remove the need for the macro:

C17 makes it ok to initialize atomics using the usual explicit initialization...

In other words:

#define KK_HEADER(scan_fsize,tag)         { scan_fsize, 0, tag, 0 }                // start with refcount of 0
#define KK_HEADER_STATIC(scan_fsize,tag)  { scan_fsize, 0, tag, KK_U32(0x80000000) } // start with a stuck refcount (RC_STUCK)
solidsnack commented 1 year ago

Making these changes to kklib.h:126 and kklib.h:127, and then fixing two lines in what is probably an older version of mimalloc, does eliminate these errors for me. Whether the resulting Koka programs are really thread-safe or not remains to be seen.