[vlc-devel] [PATCH] d3d11_adjust: Pass a non-const pointer to atomic_load

Hugo Beauzée-Luyssen hugo at beauzee.fr
Mon Feb 19 13:57:10 CET 2018


On Mon, Feb 19, 2018, at 1:53 PM, Steve Lhomme wrote:
> Le 19/02/2018 à 13:42, Martin Storsjö a écrit :
> > This fixes compilation with clang, which previously errored
> > out with this message:
> >
> > error: address argument to atomic operation must be a pointer to non-const _Atomic
> >        type ('const atomic_int *' (aka 'const _Atomic(int) *') invalid)
> >      int level = atomic_load(&p_level->level);
> >                  ^           ~~~~~~~~~~~~~~~
> 
> This is odd as atomic_load() doesn't change the internal value. In C++11 
> atomic::load() is a const method.
> But feel free to push.
> 

That's what I thought as well, but the C11 standard specifies the parameter to be a pointer to a non-const volatile value. Actually the documentation on cppreference.com seems invalid to that regard.


-- 
  Hugo Beauzée-Luyssen
  hugo at beauzee.fr


More information about the vlc-devel mailing list