Open arielmol opened 10 months ago
Just by removing volatile
from https://github.com/WKDSMRT/realsense-gstreamer/blob/4c11e3d64ae67fea84db77145743db8522d3989a/src/gstrealsensemeta.cpp#L32
It builds cleanly, but I wonder the side effects of that?
Quoting Philip Chimento from here:
On platforms where g_once_init_enter() is defined to use C11 atomic builtins, passing a pointer to a volatile value is an error in GCC 11 and later, in C++.
More info about the GCC change: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95378 https://gcc.gnu.org/pipermail/gcc-patches/2020-June/548283.html
However, it's my understanding that in modern C++ there is no longer a need to guard the initialization of these variables. Since C++11, static local variables in a function are guaranteed to be initialized only once, the first time control passes through that function. So we can just remove the g_once_init_enter guard.
So it seems if C++11 is used, then volatile is not needed or g_once_init_enter is not needed? I dont get it.
Did you fix this? I'm also on gcc 11.4.0 and am getting the same error, so is this a C++ 11 vs C++ 17 issue?
As per requirements "GStreamer 1.0 or higher", I tried with v1.16.
gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)