[vlc-devel] [PATCH] win32: build.sh: trigger build errors on dubious pointer use
Steve Lhomme
robux4 at ycbcr.xyz
Tue Mar 17 12:02:02 CET 2020
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.
>
> 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.
I'm not sure what you're referring to but either we don't use any of
these or the casts are already done properly since the code compiles
with these checks on.
> 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