[vlc-devel] New Defects reported by Coverity Scan for vlc
Rémi Denis-Courmont
remi at remlab.net
Wed Aug 22 17:53:20 CEST 2018
Le keskiviikkona 22. elokuuta 2018, 16.37.28 EEST Steve Lhomme a écrit :
> On 21/08/2018 16:33, Thomas Guillem wrote:
> > On Tue, Aug 21, 2018, at 16:21, Romain Vimont wrote:
> >> On Tue, Aug 21, 2018 at 04:59:43PM +0300, Rémi Denis-Courmont wrote:
> >>> Le tiistaina 21. elokuuta 2018, 11.12.06 EEST Romain Vimont a écrit :
> >>>> False-positive?
> >>>>
> >>>> In vlc_list.h:
> >>>> #define vlc_list_entry_p(node, p, member) \
> >>>>
> >>>> (0 ? (p) : (void *)(((char *)(node)) - vlc_list_offset_p(p,
> >>>>
> >>>> member)))
> >>>>
> >>>> Just for info, why "0 ? (p) : XXX" here?
> >>>
> >>> Conversion to type of p.
>
> Maybe that was the intention but p is actually a pointer to some struct.
> So at best it's a conversion to a pointer of p's type. Which is in line
> with the cast to (void*) in the following expression.
True but at least it preserves the qualifiers, notably const and does not rely
on non-standard constructs such as typeof.
--
Rémi Denis-Courmont
http://www.remlab.net/
More information about the vlc-devel
mailing list