[vlc-devel] [PATCH v2] package/win32: build.sh: trigger build errors on dubious pointer use

Steve Lhomme robux4 at ycbcr.xyz
Tue Mar 17 15:32:55 CET 2020


On 2020-03-17 15:00, Rémi Denis-Courmont wrote:
> Le tiistaina 17. maaliskuuta 2020, 14.53.13 EET Steve Lhomme a écrit :
>> On 2020-03-17 13:44, Rémi Denis-Courmont wrote:
>>> Le tiistaina 17. maaliskuuta 2020, 14.08.18 EET Steve Lhomme a écrit :
>>>> As 48442d3536edae578f1a384e73346d1e2a4c0061 proved, people don't read
>>>> warnings.
>>>
>>> If you don't read warnings, you're free to enable warning as error in YOUR
>>> build.
>>
>> I do but nobody is perfect. And some warnings are more important than
>> others. Pointer safety is at the top of my priorities.
> 
> Then you don't need this patch at all.

I do. It helped a lot when I had to refactor large parts of the code, 
even on Linux.

>>> There are plenty of cases were pointer type warnings are harmless, or
>>> theoretically invalid but practically harmless (especially on Windows,
>>> which institutionalized aliasing violations).
>>
>> Again, this is at best theoretical. I have neither any of those issues
>> with master for months with clang and gcc. So please provide an example
>> where this would create an error when it shouldn't.
> 
> Again *almost* every COM instantiation in the VLC code base (and in many other
> code bases) is an invalid pointer conversion. And it's helplessly muted by an
> explicit but invalid cast to void **.

I am not advocating to remove all casts from the code. Sometimes it's 
useful. I'm talking about pointers that are simply from incompatible 
types (incompatible-pointer-types) that cannot be casted away without 
breaking things.


More information about the vlc-devel mailing list