aboutsummaryrefslogtreecommitdiff
path: root/libbacktrace/internal.h
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2020-10-20 11:47:35 -0700
committerIan Lance Taylor <iant@golang.org>2020-10-20 11:49:58 -0700
commitd962ef77dadea87b2bf30487bddda00c350bf0ba (patch)
tree258889e52b0c95589f726d511bb1e87a7d77f910 /libbacktrace/internal.h
parente864d395b4e862cece37abe178e7ebd631b5348b (diff)
downloadgcc-d962ef77dadea87b2bf30487bddda00c350bf0ba.zip
gcc-d962ef77dadea87b2bf30487bddda00c350bf0ba.tar.gz
gcc-d962ef77dadea87b2bf30487bddda00c350bf0ba.tar.bz2
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.
Diffstat (limited to 'libbacktrace/internal.h')
-rw-r--r--libbacktrace/internal.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/libbacktrace/internal.h b/libbacktrace/internal.h
index 047a700..659db9e 100644
--- a/libbacktrace/internal.h
+++ b/libbacktrace/internal.h
@@ -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