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

Steve Lhomme robux4 at ycbcr.xyz
Thu Oct 3 08:06:09 CEST 2019

And on missing field initializers in structures.

Mismatching pointers are usually a result of using the incorrect pointer and
might trigger crashes.

Missing initializers are useful for structures of callbacks, to make sure a new
callback is not missing by accident. It's always possible to put NULL, on
purpose, knowingly.

Both flags produce no error on win32/win64 with clang or gcc.
 extras/package/win32/build.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/extras/package/win32/build.sh b/extras/package/win32/build.sh
index 5c1c7809900..38d4ecb1469 100755
--- a/extras/package/win32/build.sh
+++ b/extras/package/win32/build.sh
@@ -168,7 +168,9 @@ if [ ! -z "$WITH_PDB" ]; then
     CONFIGFLAGS="$CONFIGFLAGS --enable-pdb"
-../extras/package/win32/configure.sh --host=$TRIPLET $CONFIGFLAGS
+../extras/package/win32/configure.sh --host=$TRIPLET $CONFIGFLAGS \
+    CFLAGS="$CFLAGS -Werror=incompatible-pointer-types -Werror=missing-field-initializers" \
+    CXXFLAGS="$CXXFLAGS -Werror=incompatible-pointer-types -Werror=missing-field-initializers"
 info "Compiling"
 make -j$JOBS

More information about the vlc-devel mailing list