[vlc-devel] [PATCH 3/3] configure: add -Werror=missing-field-initializers option to the compiler

Steve Lhomme robux4 at ycbcr.xyz
Wed Dec 18 09:19:17 CET 2019

On 2019-12-17 18:22, Rémi Denis-Courmont wrote:
> Le tiistaina 17. joulukuuta 2019, 16.09.29 EET Steve Lhomme a écrit :
>> This avoids leaving some fields initialized in structures that require
>> initialization (like in the video context operations). It's always better to
>> set NULL (with a TODO/FIXME is needed) explicitly than forget it.
>> Compound literal designated initializers are not affected.
> That's great but designated initializers don't work in C++, or in common C/C++

Then don't use such initializers in C++ code.

> headers, and more generally, perfectly valid code that just wants to
> initialize values to the default nul.

It's better to explicitly set NULL for a callback IMO than not paying 
attention at all in code you don't know about. That will only be found 
in the bots if we can detect such missed code change early.

> This does not belong as an error. Denis and I have already made the exact same
> point not that long ago.

How about an option to force extra compilation checks ?

More information about the vlc-devel mailing list