[vlc-devel] [PATCH] configure: fail on casting incompatible pointers

Steve Lhomme robux4 at ycbcr.xyz
Wed Oct 2 14:39:21 CEST 2019


On 2019-10-02 13:36, Rémi Denis-Courmont wrote:
> I'm referring to a time when we had fewer platforms, fewer compiler 
> versions and fewer contribs yes. In other words, warning as error is an 
> even worse idea now.
> 
> We only do it for missing declaration because it caused a lot of actual 
> bugs on 64-bits. 

> I can't see that problem with bad casts.

If you don't see a problem with bad casts we have a serious problem.

> Le 2 octobre 2019 14:23:01 GMT+03:00, Steve Lhomme <robux4 at ycbcr.xyz> a 
> écrit :
> 
>     On 2019-10-02 13:17, Rémi Denis-Courmont wrote:
> 
>         So you take responsibility for guaranteeing that all headers of all
>         underlying libraries and SDK will never cause cast warnings?
> 
> 
>     Absolutely.
> 
>         We already discussed this, and everybody except Pierre d'H. was
>         against,
>         for good reasons.
> 
> 
>     You must be talking about a time we didn't have much contribs or patches
>     for contribs or C code we relied on wasn't clean. I think the quality of
>     C code we use/produce has greatly improved. Maybe dirty contribs have
>     also been removed.
> 
>         Le 2 octobre 2019 14:03:32 GMT+03:00, Steve Lhomme
>         <robux4 at ycbcr.xyz> a
>         écrit :
> 
>         On 2019-10-02 13:02, Rémi Denis-Courmont wrote:
> 
>         Yes and last I checked, VLC includes libavutil header files.
> 
> 
>         I do include libavutil and have no problem with this compiler flag.
> 
>         Le 2 octobre 2019 13:27:38 GMT+03:00, Steve Lhomme
>         <robux4 at ycbcr.xyz> a
>         écrit :
> 
>         On 2019-10-02 12:20, Rémi Denis-Courmont wrote:
> 
>         And VLC depends on some libraries that rely on bad casts, notably
>         libavutil (heap helpers).
> 
> 
>         This is the configure script of VLC, not the contribs. I use
>         this flag
>         all day long on Win32 and Linux builds with no issue. That enables
>         spotting errors like the AMT one very quickly.
> 
>         Le 2 octobre 2019 13:18:30 GMT+03:00, "Rémi Denis-Courmont"
>         <remi at remlab.net> a écrit :
> 
>         Next people will add incorrect manual casts to silence the errors
>         instead of fixing them properly. Not a good idea.
> 
>         Le 2 octobre 2019 13:14:14 GMT+03:00, Romain Vimont
>         <rom1v at videolabs.io> a écrit :
>         ------------------------------------------------------------------------
>         configure.ac | 2 +-
>         1 file changed, 1 insertion(+), 1 deletion(-)
> 
>         diff --git a/configure.ac b/configure.ac
>         index 210b4ca537..2fa70daf22 100644
>         --- a/configure.ac
>         +++ b/configure.ac
>         @@ -988,7 +988,7 @@ dnl
>         AX_APPEND_COMPILE_FLAGS([-Wall -Wextra -Wsign-compare -Wundef
>         -Wpointer-arith -Wvolatile-register-var -Wformat
>         -Wformat-security -Wduplicated-branches -Wduplicated-cond],
>         [CFLAGS])
>         AX_APPEND_COMPILE_FLAGS([-Wall -Wextra -Wsign-compare -Wundef
>         -Wpointer-arith -Wvolatile-register-var -Wformat
>         -Wformat-security -Wduplicated-branches -Wduplicated-cond],
>         [CXXFLAGS])
> 
>         -AX_APPEND_COMPILE_FLAGS([-Wbad-function-cast -Wwrite-strings
>         -Wmissing-prototypes -Werror-implicit-function-declaration
>         -Winit-self -Wlogical-op -Wshadow=local
>         -Wmultistatement-macros], [CFLAGS])
>         +AX_APPEND_COMPILE_FLAGS([-Wbad-function-cast -Wwrite-strings
>         -Wmissing-prototypes -Werror-implicit-function-declaration
>         -Winit-self -Wlogical-op -Wshadow=local -Wmultistatement-macros
>         -Werror=incompatible-pointer-types], [CFLAGS])
>         AX_APPEND_COMPILE_FLAGS([-pipe], [CFLAGS])
> 
>         dnl
> 
> 
>         -- 
>         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
>         ------------------------------------------------------------------------
>         vlc-devel mailing list
>         To unsubscribe or modify your subscription options:
>         https://mailman.videolan.org/listinfo/vlc-devel
> 
> 
>         -- 
>         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
>         ------------------------------------------------------------------------
>         vlc-devel mailing list
>         To unsubscribe or modify your subscription options:
>         https://mailman.videolan.org/listinfo/vlc-devel
> 
> 
>         -- 
>         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
> 
>     ------------------------------------------------------------------------
>     vlc-devel mailing list
>     To unsubscribe or modify your subscription options:
>     https://mailman.videolan.org/listinfo/vlc-devel
> 
> 
> -- 
> 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