[vlc-commits] package/win32: build.sh: add option to do more checks during VLC compilation
Steve Lhomme
git at videolan.org
Tue Mar 24 16:04:30 CET 2020
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Feb 10 08:49:07 2020 +0100| [994e5cbc7dc66509996fddab43b9f3b5b0ae98ec] | committer: Steve Lhomme
package/win32: build.sh: add option to do more checks during VLC compilation
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. But they cannot
be set globally outside of the build script as many contribs will likely fail
these tests and we shouldn't refuse/patch a contrib just for that.
I have been compiling with these flags for weeks without issues. It helped find
some issue (48442d3536edae578f1a384e73346d1e2a4c0061) that were pushed
unnoticed without these checks.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=994e5cbc7dc66509996fddab43b9f3b5b0ae98ec
---
extras/package/win32/build.sh | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/extras/package/win32/build.sh b/extras/package/win32/build.sh
index 08f69519b0..9f1a009d26 100755
--- a/extras/package/win32/build.sh
+++ b/extras/package/win32/build.sh
@@ -28,11 +28,12 @@ OPTIONS:
-s Interactive shell (get correct environment variables for build)
-b <url> Enable breakpad support and send crash reports to this URL
-d Create PDB files during the build
+ -x Add extra checks when compiling
EOF
}
ARCH="x86_64"
-while getopts "hra:pcli:sb:d" OPTION
+while getopts "hra:pcli:sb:dx" OPTION
do
case $OPTION in
h)
@@ -67,6 +68,9 @@ do
d)
WITH_PDB="yes"
;;
+ x)
+ EXTRA_CHECKS="yes"
+ ;;
esac
done
shift $(($OPTIND - 1))
@@ -223,6 +227,10 @@ fi
if [ ! -z "$WITH_PDB" ]; then
CONFIGFLAGS="$CONFIGFLAGS --enable-pdb"
fi
+if [ ! -z "$EXTRA_CHECKS" ]; then
+ CFLAGS="$CFLAGS -Werror=incompatible-pointer-types -Werror=missing-field-initializers"
+ CXXFLAGS="$CXXFLAGS -Werror=missing-field-initializers"
+fi
${SCRIPT_PATH}/configure.sh --host=$TRIPLET --with-contrib=../contrib/$TRIPLET $CONFIGFLAGS
More information about the vlc-commits
mailing list