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

Steve Lhomme robux4 at ycbcr.xyz
Tue Dec 17 15:09:29 CET 2019


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.

This is tested on Linux and Windows builds successfully.
---
 configure.ac | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 9088342a896..24d285b166b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -85,9 +85,9 @@ AS_IF([test -n "${with_binary_version}"],[
 
 dnl Prevent clang from accepting unknown flags with a mere warning
 AX_APPEND_COMPILE_FLAGS([-Werror=unknown-warning-option -Werror=invalid-command-line-argument
-                         -Werror=incompatible-pointer-types], [CFLAGS])
+                         -Werror=incompatible-pointer-types -Werror=missing-field-initializers], [CFLAGS])
 AX_APPEND_COMPILE_FLAGS([-Werror=unknown-warning-option -Werror=invalid-command-line-argument
-                         -Werror=incompatible-pointer-types], [CXXFLAGS])
+                         -Werror=incompatible-pointer-types -Werror=missing-field-initializers], [CXXFLAGS])
 
 dnl
 dnl  Check the operating system
-- 
2.17.1



More information about the vlc-devel mailing list