[vlc-devel] [PATCH] objects: get the vlc_object_t from vlc_object_internals using vlc_internals()

Rémi Denis-Courmont remi at remlab.net
Tue Jul 25 18:33:09 CEST 2017

Le tiistaina 25. heinäkuuta 2017, 18.06.32 EEST Steve Lhomme a écrit :
> So that's it coherent with the rest of the usages.

Not really. The other uses operate on an initialized object. Here, we are 
creating and initializing the object.

> Incidentally I came into this because on some other compilers
> vlc_internals() returns the position of aligned_end and not the end of the
> vlc_object_internals structure.

As far as I know, that is actually not possible. The very definition of the 
flexible array in ISO C ensures that the two expressions are equivalent. One 
uses byte offsets, and the other direct pointer arithmetic.


More information about the vlc-devel mailing list