diff options
author | Ian Lance Taylor <iant@golang.org> | 2024-07-18 11:34:09 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2024-07-18 11:35:44 -0700 |
commit | 248e8530dd0298e9bbe099c651d5d9c4d2a0c0f9 (patch) | |
tree | db32cad68ee86eca185c05391dd67a7ae1dd0713 /libbacktrace | |
parent | 6962835bca3e6bef0f6ceae84a7814138b08b8a5 (diff) | |
download | gcc-248e8530dd0298e9bbe099c651d5d9c4d2a0c0f9.zip gcc-248e8530dd0298e9bbe099c651d5d9c4d2a0c0f9.tar.gz gcc-248e8530dd0298e9bbe099c651d5d9c4d2a0c0f9.tar.bz2 |
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.
Diffstat (limited to 'libbacktrace')
-rw-r--r-- | libbacktrace/elf.c | 14 | ||||
-rw-r--r-- | libbacktrace/internal.h | 5 |
2 files changed, 12 insertions, 7 deletions
diff --git a/libbacktrace/elf.c b/libbacktrace/elf.c index e8d67fe..0040479 100644 --- a/libbacktrace/elf.c +++ b/libbacktrace/elf.c @@ -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; diff --git a/libbacktrace/internal.h b/libbacktrace/internal.h index a119cda..fe2abe5 100644 --- a/libbacktrace/internal.h +++ b/libbacktrace/internal.h @@ -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__)) |