[Pkg-kde-extras] Bug#997252: qt-gstreamer: FTBFS: gatomic.h:113:19: error: argument 2 of ‘__atomic_load’ must not be a pointer to a ‘volatile’ type

Simon McVittie smcv at debian.org
Fri Jul 22 10:08:18 BST 2022


Control: tags -1 + patch

On Sat, 23 Oct 2021 at 21:23:19 +0200, Lucas Nussbaum wrote:
> During a rebuild of all packages in sid, your package failed to build
> on amd64.
> 
> Relevant part (hopefully):
> > /<<PKGBUILDDIR>>/elements/gstqtvideosink/gstqtvideosinkbase.cpp: In static member function ‘static GType GstQtVideoSinkBase::get_type()’:
> > /usr/include/glib-2.0/glib/gatomic.h:113:19: error: argument 2 of ‘__atomic_load’ must not be a pointer to a ‘volatile’ type

The attached patch seems to resolve the FTBFS. I have not tested the
resulting binaries, but it's a trivial change following the same pattern
seen in many other GLib-based libraries.

The documentation of g_once_init_enter() now says:

    While location has a volatile qualifier, this is a historical artifact
    and the pointer passed to it should not be volatile.

volatile behaves like const, so it is valid to pass a pointer of type "T*"
to a function like g_once_init_enter() that is declared to take an argument
of type "volatile T*".

(Conversely, it would not be valid to pass a pointer of type "volatile T*"
to a function like g_mutex_lock() that is declared to take an argument
of type "T*" - again, this is the same rule as for const.)

    smcv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Drop-unnecessary-volatile-qualifier-from-g_once_init_ente.patch
Type: text/x-diff
Size: 1342 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-kde-extras/attachments/20220722/6c03f355/attachment-0001.patch>


More information about the pkg-kde-extras mailing list