[vlc-devel] New Defects reported by Coverity Scan for vlc
robux4 at ycbcr.xyz
Wed Aug 22 15:37:28 CEST 2018
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 :
>>>> In vlc_list.h:
>>>> #define vlc_list_entry_p(node, p, member) \
>>>> (0 ? (p) : (void *)(((char *)(node)) - vlc_list_offset_p(p,
>>>> 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.
Now looking at C11
6.5.15) and C++11
section 5.16) between p* and void*, void* is always picked. So the
ternary operator doesn't help at all. We always end up with a void*.
Same thing with vlc_list_entry_dummy().
>> Thank you.
>> This could deserve a comment :)
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
More information about the vlc-devel