[vlc-devel] [PATCH 1/2] VLC_FALLTHROUGH macro to avoid unnecessary warnings

Steve Lhomme robux4 at ycbcr.xyz
Fri Mar 22 09:08:59 CET 2019


Hi,

 From a quick look it seems that this attribute was added in gcc 7 but 
we support older versions of gcc. So you need to check the gcc version.

Also you may need to check if it works with Clang as well and since what 
version.

On 3/21/2019 8:10 PM, chishtiawais511 at gmail.com wrote:
> From: Awais Chishti <chishtiawais511 at gmail.com>
>
> ---
>   include/vlc_common.h | 13 +++++++++++++
>   1 file changed, 13 insertions(+)
>
> diff --git a/include/vlc_common.h b/include/vlc_common.h
> index 033c618677..f3eb10271a 100644
> --- a/include/vlc_common.h
> +++ b/include/vlc_common.h
> @@ -185,6 +185,19 @@
>   # define VLC_USED
>   #endif
>   
> +/**
> + * Explicitly indicate fallthrough
> + *
> + * Use this macro as a replacement for //fallthrough comments in switch blocks.
> + *
> + * This may disable inaccurate compiler warnings of implicit fallthrough.
> + */
> +#ifdef __GNUC__
> +# define VLC_FALLTHROUGH __attribute__ ((fallthrough));
> +#else
> +# define VLC_FALLTHROUGH
> +#endif
> +
>   #if defined (__ELF__) || defined (__MACH__)
>   # define VLC_WEAK __attribute__((weak))
>   #else
> -- 
> 2.21.0
>
> _______________________________________________
> 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