What other headers have you included in the file you’re compiling?
<stdatomic.h> is getting included at some point. This is a C header, which gives you atomic_is_lock_free in the global namespace, as defined in the C standard. Evidently this is implemented in clang as a macro which is why you get that particular error message.
You’re writing C++ code, which means you should be using <atomic> which is the C++ header. This would give you std::atomic_is_lock_free in the std namespace, and you wouldn’t have a problem.
Clearly you have a macro that’s including <boost/property_tree/json_parser.hpp>. What other headers are you including? I mean all headers, including standard library ones.
Did you mean that the cling/clang using C header, while the boost library using the C++ header?
No, I think some piece of your code is including the C header in C++ code.
So it’s not that then. Can you open a ROOT prompt and see what happens if you type in atomic_is_lock_free(2)? That’ll tell us if <stdatomic.h> is included in a startup file or something.
The clang version isn’t too old (well, it is and this causes other issues if you use std::variant, but it’s not what’s causing this problem).
It seems ROOT is automatically including <stdatomic.h> when it should be including <atomic>. This may be because you have #include <stdatomic.h> in a startup file (like .rootlogon.C), or it’s a configuration issue with the way you built ROOT.
I’ve test it without .rootlogon.C file.
I thought the homebrew version of root is built with <stdatomic.h>
how could I change way of building ROOT to not to include <stdatomic.h>?