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

Steve Lhomme robux4 at ycbcr.xyz
Tue Mar 17 12:05:18 CET 2020


This version removes the flags for C++ which are not needed as the 
language has better checks on pointers.

On 2020-03-17 12:02, Steve Lhomme wrote:
> 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.
> 
> I have been compiling with these flags for weeks without issues. It helped find
> some issue (48442d3536edae578f1a384e73346d1e2a4c0061) that were pushed
> unnoticed without these checks.
> ---
>   extras/package/win32/build.sh | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/extras/package/win32/build.sh b/extras/package/win32/build.sh
> index 8805a08b2eb..d1035f1b543 100755
> --- a/extras/package/win32/build.sh
> +++ b/extras/package/win32/build.sh
> @@ -210,7 +210,8 @@ if [ ! -z "$WITH_PDB" ]; then
>       CONFIGFLAGS="$CONFIGFLAGS --enable-pdb"
>   fi
>   
> -${SCRIPT_PATH}/configure.sh --host=$TRIPLET --with-contrib=../contrib/$TRIPLET $CONFIGFLAGS
> +${SCRIPT_PATH}/configure.sh --host=$TRIPLET --with-contrib=../contrib/$TRIPLET $CONFIGFLAGS \
> +    CFLAGS="$CFLAGS -g -Werror=incompatible-pointer-types -Werror=missing-field-initializers"
>   
>   info "Compiling"
>   make -j$JOBS
> -- 
> 2.17.1
> 
> _______________________________________________
> 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