mirror of
https://github.com/gcc-mirror/gcc.git
synced 2024-11-21 13:40:47 +00:00
libbacktrace: use __has_attribute for fallthrough
Also convert some FALLTHROUGH comments to ATTRIBUTE_FALLTHROUGH. * internal.h: Use __has_attribute to check for fallthrough attribute. * elf.c (elf_zstd_decompress): Use ATTRIBUTE_FALLTHROUGH rather than a FALLTHROUGH comment.
This commit is contained in:
parent
6962835bca
commit
248e8530dd
@ -4848,25 +4848,25 @@ elf_zstd_decompress (const unsigned char *pin, size_t sin,
|
||||
{
|
||||
case 8:
|
||||
*pout++ = *plit++;
|
||||
/* FALLTHROUGH */
|
||||
ATTRIBUTE_FALLTHROUGH;
|
||||
case 7:
|
||||
*pout++ = *plit++;
|
||||
/* FALLTHROUGH */
|
||||
ATTRIBUTE_FALLTHROUGH;
|
||||
case 6:
|
||||
*pout++ = *plit++;
|
||||
/* FALLTHROUGH */
|
||||
ATTRIBUTE_FALLTHROUGH;
|
||||
case 5:
|
||||
*pout++ = *plit++;
|
||||
/* FALLTHROUGH */
|
||||
ATTRIBUTE_FALLTHROUGH;
|
||||
case 4:
|
||||
*pout++ = *plit++;
|
||||
/* FALLTHROUGH */
|
||||
ATTRIBUTE_FALLTHROUGH;
|
||||
case 3:
|
||||
*pout++ = *plit++;
|
||||
/* FALLTHROUGH */
|
||||
ATTRIBUTE_FALLTHROUGH;
|
||||
case 2:
|
||||
*pout++ = *plit++;
|
||||
/* FALLTHROUGH */
|
||||
ATTRIBUTE_FALLTHROUGH;
|
||||
case 1:
|
||||
*pout++ = *plit++;
|
||||
break;
|
||||
|
@ -56,6 +56,11 @@ POSSIBILITY OF SUCH DAMAGE. */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __has_attribute
|
||||
# if __has_attribute(fallthrough)
|
||||
# define ATTRIBUTE_FALLTHROUGH __attribute__ ((fallthrough))
|
||||
# endif
|
||||
#endif
|
||||
#ifndef ATTRIBUTE_FALLTHROUGH
|
||||
# if (GCC_VERSION >= 7000)
|
||||
# define ATTRIBUTE_FALLTHROUGH __attribute__ ((__fallthrough__))
|
||||
|
Loading…
Reference in New Issue
Block a user