Closed gitterdude closed 3 years ago
I can't reproduce it here with gcc 10.2 on debian/sid.
But I've seen that the Gnome folks have recently changed the type check for gapcae_oldval.
https://gitlab.gnome.org/GNOME/glib/-/tags/2.67.3
Could you try to edit gx_system.h line 135
change
return g_atomic_pointer_compare_and_exchange(reinterpret_cast<void* volatile*>(p), static_cast<void*>(oldv), newv);
to
return g_atomic_pointer_compare_and_exchange(reinterpret_cast<void* volatile*>(p), static_cast<volatile void*>(oldv), newv);
let me know if that avoid the error.
after checking a bit more it seems that it should become
return g_atomic_pointer_compare_and_exchange(reinterpret_cast<void* >(p), static_cast<void>(oldv), newv);
so, remove the volatile
qualifier
https://github.com/GNOME/glib/blob/master/glib/gatomic.c#L390
Yes, changing void* volatile*
to void**
made gcc much happier.
Thanks.
Apparently this issue was caused not by a gcc update but by glib 2.68.
Maybe the std::atomic
primitive should be used. I have a WiP patch to remove these g_atomic from the LV2 plugins.
I get this when I try to compile the latest git source, 0.28.3-1667-g819c891e
../src/headers/gx_system.h: In instantiation of ‘bool gx_system::atomic_compare_and_exchange(T**, T*, T*) [with T = _jack_session_event]’: ../src/gx_head/engine/gx_jack.cpp:1110:79: required from here /usr/include/glib-2.0/glib/gatomic.h:206:45: warning: invalid conversion from ‘volatile void*’ to ‘void*’ [-fpermissive] 206 | __atomic_compare_exchange_n ((atomic), &gapcae_oldval, (newval), FALSE, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) ? TRUE : FALSE;
and it points to the &gapcae_oldval variableMy C-Fu isn't strong enough to figure out the proper solution but the quick-n-dirty fix was to add -fpermissive to CXXFLAGS in trunk/build/c4che/_cache.py