Open tom-sherman opened 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).
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)
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.
I receive these warnings on m1 mac when compiling
Version: