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

Steve Lhomme robux4 at ycbcr.xyz
Thu Oct 3 14:26:03 CEST 2019


On 2019-10-03 14:06, Rémi Denis-Courmont wrote:
> This is as bad, if not worse, in the win32 script that in the common 
> configure.

If you want to add the flags for all platforms it's fine with me.

> Besides, Windows has in-built incorrect pointer types, so that's making 
> sure it won't work. E.g. haphazardly using char or uchar instead of void 
> for binary I/O functions.

Given the current master is compiling and has been for the last few 
months with these flags on Windows, I think we do not have these 
problems. Plus there aren't many people using the win32 build.sh. There 
are the buildbots, me and maybe Thomas and a few other VLC developers. 
Building for win32 is a nightmare and the documentation is long outdated 
and often misleading.

On top of that Windows almost exclusively builds with contribs we build 
ourselves. If there is ever an issue we can fix them. (because this kind 
of warning-turned-into-error always exhibit ugly code that needs to be 
fixed)

> Le 3 octobre 2019 09:06:09 GMT+03:00, Steve Lhomme <robux4 at ycbcr.xyz> a 
> écrit :
> 
>     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"
>       fi
>       
>     -../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
> 
> 
> -- 
> 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