mirror of
https://github.com/ianlancetaylor/libbacktrace.git
synced 2026-03-31 22:49:09 +08:00
libbacktrace: use __attribute__((__fallthrough__))
Use an attribute rather than a comment when falling through a switch case. * internal.h (ATTRIBUTE_FALLTHROUGH): Define. * elf.c (elf_zlib_inflate): Use ATTRIBUTE_FALLTHROUGH.
This commit is contained in:
@@ -56,6 +56,14 @@ POSSIBILITY OF SUCH DAMAGE. */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef ATTRIBUTE_FALLTHROUGH
|
||||
# if (GCC_VERSION >= 7000)
|
||||
# define ATTRIBUTE_FALLTHROUGH __attribute__ ((__fallthrough__))
|
||||
# else
|
||||
# define ATTRIBUTE_FALLTHROUGH
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_SYNC_FUNCTIONS
|
||||
|
||||
/* Define out the sync functions. These should never be called if
|
||||
|
||||
Reference in New Issue
Block a user