[vlc-devel] [PATCH 3/3] configure: add -Werror=missing-field-initializers option to the compiler
Steve Lhomme
robux4 at ycbcr.xyz
Wed Dec 18 10:12:39 CET 2019
On 2019-12-18 10:04, Rémi Denis-Courmont wrote:
> You can't always use explicit initialisation. Some structures have
> partially system-dependent layout.
This is opt-in. I'm not saying all structures should be set that way. I
used it for the picture_context_t, vlc_decoder_device_operations and
vlc_video_context_operations.
You can see that the android vlc_decoder_device_operations /
vlc_video_context_operations do not use it (meaning it may be subject to
missing mandatory callbacks in the future).
> Le 18 décembre 2019 10:19:17 GMT+02:00, Steve Lhomme <robux4 at ycbcr.xyz>
> a écrit :
>
> 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 ?
> ------------------------------------------------------------------------
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
>
>
> --
> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser
> ma brièveté.
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
>
More information about the vlc-devel
mailing list