summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/cc/compat_compiler.h6
-rw-r--r--src/lib/crypt_ops/crypto_digest.c2
-rw-r--r--src/lib/net/address.c1
3 files changed, 8 insertions, 1 deletions
diff --git a/src/lib/cc/compat_compiler.h b/src/lib/cc/compat_compiler.h
index 3a0f307186..fbe6a38f1f 100644
--- a/src/lib/cc/compat_compiler.h
+++ b/src/lib/cc/compat_compiler.h
@@ -50,6 +50,12 @@
#define CHECK_SCANF(formatIdx, firstArg)
#endif /* defined(__GNUC__) */
+#if defined(HAVE_ATTR_FALLTHROUGH)
+#define FALLTHROUGH __attribute__((fallthrough))
+#else
+#define FALLTHROUGH
+#endif
+
/* What GCC do we have? */
#ifdef __GNUC__
#define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
diff --git a/src/lib/crypt_ops/crypto_digest.c b/src/lib/crypt_ops/crypto_digest.c
index 26f06c6c79..1b2724b2aa 100644
--- a/src/lib/crypt_ops/crypto_digest.c
+++ b/src/lib/crypt_ops/crypto_digest.c
@@ -100,7 +100,7 @@ library_supports_digest(digest_algorithm_t alg)
switch (alg) {
case DIGEST_SHA1: /* Fall through */
case DIGEST_SHA256: /* Fall through */
- case DIGEST_SHA512: /* Fall through */
+ case DIGEST_SHA512:
return true;
case DIGEST_SHA3_256: /* Fall through */
case DIGEST_SHA3_512: /* Fall through */
diff --git a/src/lib/net/address.c b/src/lib/net/address.c
index a2d234b742..076ca3eb34 100644
--- a/src/lib/net/address.c
+++ b/src/lib/net/address.c
@@ -926,6 +926,7 @@ tor_addr_copy_tight(tor_addr_t *dest, const tor_addr_t *src)
break;
case AF_INET6:
memcpy(dest->addr.in6_addr.s6_addr, src->addr.in6_addr.s6_addr, 16);
+ break;
case AF_UNSPEC:
break;
// LCOV_EXCL_START