[vlc-devel] [PATCH] vlc_common.h: Fix VLC_OBJECT when building with clang

Rémi Denis-Courmont remi at remlab.net
Wed Sep 14 18:26:38 CEST 2016


Le keskiviikkona 14. syyskuuta 2016, 19.25.12 EEST Rémi Denis-Courmont a 
écrit :
> Le keskiviikkona 14. syyskuuta 2016, 18.10.31 EEST Hugo Beauzée-Luyssen a
> 
> écrit :
> > ---
> > 
> >  include/vlc_common.h | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/include/vlc_common.h b/include/vlc_common.h
> > index 5a6bf19..59988fa 100644
> > --- a/include/vlc_common.h
> > +++ b/include/vlc_common.h
> > @@ -476,7 +476,8 @@ struct vlc_common_members
> > 
> >  #if !defined(__cplusplus) && (__STDC_VERSION__ >= 201112L)
> >  # define VLC_OBJECT(x) \
> >  
> >      _Generic((x)->obj, \
> > 
> > -        struct vlc_common_members: (vlc_object_t *)(&(x)->obj) \
> > +        struct vlc_common_members: (vlc_object_t *)(&(x)->obj), \
> > +        const struct vlc_common_members: (const vlc_object_t
> > *)(&(x)->obj)
> > \ )
> > 
> >  #elif VLC_GCC_VERSION(4,0)
> >  # ifndef __cplusplus
> 
> That´s not right. VLC_OBJECT() expects a pointer to non-constant. We do want
> to warn or fail otherwise.

...and vlc_object_get_name() may need fixing.

-- 
Rémi Denis-Courmont
http://www.remlab.net/



More information about the vlc-devel mailing list