Hi

Apparently in some recent glib commit, probably
f304df34c7335526ef08701dc0b4a35f03299249 first released in 2.71.0, they
changed a macro in a way that fixes warnings with C, but fails to compile
with stricter C++ compilers (Clang 8, 9, 10, 12 and 13 on FreeBSD, but
probably GCC+Linux too).

This regression causes our build to fails in the "avmedia" module, with
errors of the form:

---snip---
/path/to/openoffice/main/avmedia/source/gstreamer/gstplayer.cxx:417:9:
error: cannot initialize a parameter of type 'gint *' (aka 'int *') with an
rvalue of type 'void *'
        g_atomic_int_compare_and_exchange(&mnLooping, 0, 1);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/glib-2.0/glib/gatomic.h:171:44: note: expanded from
macro 'g_atomic_int_compare_and_exchange'
    __atomic_compare_exchange_n ((atomic), (void *) (&(gaicae_oldval)),
(newval), FALSE, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) ? TRUE : FALSE; \
---snip---


This was semi-fixed in glib by commit
ad23894c1595482cdc10c17a4070a977e396ca4a which was first released in glib
2.73.0. However that doesn't fix the problem for us, as they require:
#if defined(glib_typeof) && defined(__cplusplus) && __cplusplus >= 201103L
while we pass "-std=gnu++98" to the compiler, so the fix is skipped.

An additional problem for Clang is that glib-typeof.h doesn't define
glib_typeof when __cplusplus is defined and the C++ standard isn't
__cplusplus >= 201103L.

I fixed both issues and sent a merge request to glib:
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2864

The patch is small and only requires changes to 2 header files, and
applying it to your current system glib header files is enough to fix the
build in avmedia.

Unfortunately at least 2-3 other build breaking bugs still exist :(. The
worst is this boost bug I am still figuring out...

Damjan

Reply via email to