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

Rémi Denis-Courmont remi at remlab.net
Fri Mar 22 11:22:01 CET 2019


Hi,

This feels much less readable than what we currently have, TBH. And as Steve noted, it'll actually unfix the warnings on Clang.

If/when there is a proper statement in ISO specs, we should use that. But in the mean time, I'd much rather stick to the comments.

Le 22 mars 2019 03:10:36 GMT+08:00, chishtiawais511 at gmail.com a écrit :
>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

-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20190322/830532ab/attachment.html>


More information about the vlc-devel mailing list