fallthrough attribute annotations.
/* config.h.in. Generated from configure.ac by autoheader. */
+/* apply the fallthrough attribute. */
+#undef ATTR_FALLTHROUGH
+
/* apply the noreturn attribute to a function that exits the program */
#undef ATTR_NORETURN
/* Define to 1 if you have the <arpa/inet.h> header file. */
#undef HAVE_ARPA_INET_H
+/* Whether the C compiler accepts the "fallthrough" attribute */
+#undef HAVE_ATTR_FALLTHROUGH
+
/* Whether the C compiler accepts the "format" attribute */
#undef HAVE_ATTR_FORMAT
fi
+
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler (${CC-cc}) accepts the \"fallthrough\" attribute" >&5
+printf %s "checking whether the C compiler (${CC-cc}) accepts the \"fallthrough\" attribute... " >&6; }
+BAKCFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -Werror"
+if test ${ac_cv_c_fallthrough_attribute+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ ac_cv_c_fallthrough_attribute=no
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+ #include <stdio.h>
+void f(int x) {
+ int y = 0;
+ switch(x) {
+ case 1:
+ y = 1;
+ __attribute__((fallthrough));
+ /* fallthrough */
+ case 2:
+ y++;
+ break;
+ case 3:
+ y = 3;
+ break;
+ }
+ printf("%d", y);
+}
+
+int
+main (void)
+{
+
+ f(1);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_c_fallthrough_attribute="yes"
+else $as_nop
+ ac_cv_c_fallthrough_attribute="no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+
+fi
+
+CFLAGS="$BAKCFLAGS"
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_fallthrough_attribute" >&5
+printf "%s\n" "$ac_cv_c_fallthrough_attribute" >&6; }
+if test $ac_cv_c_fallthrough_attribute = yes; then
+
+printf "%s\n" "#define HAVE_ATTR_FALLTHROUGH 1" >>confdefs.h
+
+
+printf "%s\n" "#define ATTR_FALLTHROUGH __attribute__((fallthrough));" >>confdefs.h
+
+else
+
+printf "%s\n" "#define ATTR_FALLTHROUGH /**/" >>confdefs.h
+
+fi
+
+
if test "$srcdir" != "."; then
CPPFLAGS="$CPPFLAGS -I$srcdir"
fi
CHECK_NORETURN_ATTRIBUTE
+AC_DEFUN([CHECK_FALLTHROUGH_ATTRIBUTE],
+[AC_REQUIRE([AC_PROG_CC])
+AC_MSG_CHECKING(whether the C compiler (${CC-cc}) accepts the "fallthrough" attribute)
+BAKCFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -Werror"
+AC_CACHE_VAL(ac_cv_c_fallthrough_attribute,
+[ac_cv_c_fallthrough_attribute=no
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h>
+void f(int x) {
+ int y = 0;
+ switch(x) {
+ case 1:
+ y = 1;
+ __attribute__((fallthrough));
+ /* fallthrough */
+ case 2:
+ y++;
+ break;
+ case 3:
+ y = 3;
+ break;
+ }
+ printf("%d", y);
+}
+]], [[
+ f(1);
+]])],[ac_cv_c_fallthrough_attribute="yes"],[ac_cv_c_fallthrough_attribute="no"])
+])
+CFLAGS="$BAKCFLAGS"
+
+AC_MSG_RESULT($ac_cv_c_fallthrough_attribute)
+if test $ac_cv_c_fallthrough_attribute = yes; then
+ AC_DEFINE(HAVE_ATTR_FALLTHROUGH, 1, [Whether the C compiler accepts the "fallthrough" attribute])
+ AC_DEFINE(ATTR_FALLTHROUGH, [__attribute__((fallthrough));], [apply the fallthrough attribute.])
+else
+ AC_DEFINE(ATTR_FALLTHROUGH,[], [apply the fallthrough attribute.])
+fi
+])dnl End of CHECK_FALLTHROUGH_ATTRIBUTE
+
+CHECK_FALLTHROUGH_ATTRIBUTE
+
if test "$srcdir" != "."; then
CPPFLAGS="$CPPFLAGS -I$srcdir"
fi
iq->state = DNS64_NEW_QUERY;
iq->started_no_cache_store = qstate->no_cache_store;
qstate->no_cache_store = 1;
+ ATTR_FALLTHROUGH
/* fallthrough */
case module_event_pass:
qstate->ext_state[id] = handle_event_pass(qstate, id);
23 July 2024: Yorgos
- Fix #1106: ratelimit-below-domain logs the wrong FROM address.
+23 July 2024: Wouter
+ - Merge #1110: Make fallthrough explicit for libworker.c.
+ - For #1110: Test for fallthrough attribute in configure and add
+ fallthrough attribute annotations.
+
19 July 2024: Wouter
- Add dnstap-sample-rate that logs only 1/N messages, for high volume
server environments. Thanks Dan Luther.
log_err("unknown command for bg worker %d",
(int)context_serial_getcmd(msg, len));
/* and fall through to quit */
- __attribute__((fallthrough));
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case UB_LIBCMD_QUIT:
free(msg);
comm_base_exit(w->base);
/* no break: also copy key item */
/* the line below is matched by gcc regex and silences
* the fallthrough warning */
+ ATTR_FALLTHROUGH
/* fallthrough */
case 1: /* ref updated, item inserted */
rep->rrsets[i] = rep->ref[i].key;
case RPZ_NODATA_ACTION: return local_zone_always_nodata;
case RPZ_DROP_ACTION: return local_zone_always_deny;
case RPZ_PASSTHRU_ACTION: return local_zone_always_transparent;
- case RPZ_LOCAL_DATA_ACTION: /* fallthrough */
+ case RPZ_LOCAL_DATA_ACTION:
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case RPZ_CNAME_OVERRIDE_ACTION: return local_zone_redirect;
case RPZ_TCP_ONLY_ACTION: return local_zone_truncate;
- case RPZ_INVALID_ACTION: /* fallthrough */
+ case RPZ_INVALID_ACTION:
+ ATTR_FALLTHROUGH
+ /* fallthrough */
default: return local_zone_invalid;
}
}
case RPZ_NODATA_ACTION: return respip_always_nodata;
case RPZ_DROP_ACTION: return respip_always_deny;
case RPZ_PASSTHRU_ACTION: return respip_always_transparent;
- case RPZ_LOCAL_DATA_ACTION: /* fallthrough */
+ case RPZ_LOCAL_DATA_ACTION:
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case RPZ_CNAME_OVERRIDE_ACTION: return respip_redirect;
case RPZ_TCP_ONLY_ACTION: return respip_truncate;
- case RPZ_INVALID_ACTION: /* fallthrough */
+ case RPZ_INVALID_ACTION:
+ ATTR_FALLTHROUGH
+ /* fallthrough */
default: return respip_invalid;
}
}
case local_zone_always_transparent: return RPZ_PASSTHRU_ACTION;
case local_zone_redirect: return RPZ_LOCAL_DATA_ACTION;
case local_zone_truncate: return RPZ_TCP_ONLY_ACTION;
- case local_zone_invalid: /* fallthrough */
+ case local_zone_invalid:
+ ATTR_FALLTHROUGH
+ /* fallthrough */
default: return RPZ_INVALID_ACTION;
}
}
case respip_always_transparent: return RPZ_PASSTHRU_ACTION;
case respip_redirect: return RPZ_LOCAL_DATA_ACTION;
case respip_truncate: return RPZ_TCP_ONLY_ACTION;
- case respip_invalid: /* fallthrough */
+ case respip_invalid:
+ ATTR_FALLTHROUGH
+ /* fallthrough */
default: return RPZ_INVALID_ACTION;
}
}
/* ........ ........ ....4444 4....... ........ */
c = src[3] >> 7 ;
+ ATTR_FALLTHROUGH
/* fallthrough */
case 3: dst[4] = b32[(src[2] & 0x0f) << 1 | c];
/* ........ .......3 3333.... ........ ........ */
c = src[2] >> 4 ;
+ ATTR_FALLTHROUGH
/* fallthrough */
case 2: dst[3] = b32[(src[1] & 0x01) << 4 | c];
/* .....111 11...... ........ ........ ........ */
c = src[1] >> 6 ;
+ ATTR_FALLTHROUGH
/* fallthrough */
case 1: dst[1] = b32[(src[0] & 0x07) << 2 | c];
switch (src_sz) {
case 1: dst[2] = '=';
dst[3] = '=';
+ ATTR_FALLTHROUGH
/* fallthrough */
case 2: dst[4] = '=';
+ ATTR_FALLTHROUGH
/* fallthrough */
case 3: dst[5] = '=';
dst[6] = '=';
+ ATTR_FALLTHROUGH
/* fallthrough */
case 4: dst[7] = '=';
}
/* ........ ........ ........ .55555.. ........ */
/* ........ ........ ....4444 4....... ........ */
dst[3] = buf[4] << 7 | buf[5] << 2 | buf[6] >> 3;
+ ATTR_FALLTHROUGH
/* fallthrough */
case 5: /* ........ ........ ....4444 4....... ........ */
/* ........ .......3 3333.... ........ ........ */
dst[2] = buf[3] << 4 | buf[4] >> 1;
+ ATTR_FALLTHROUGH
/* fallthrough */
case 4: /* ........ .......3 3333.... ........ ........ */
/* ........ ..22222. ........ ........ ........ */
/* .....111 11...... ........ ........ ........ */
dst[1] = buf[1] << 6 | buf[2] << 1 | buf[3] >> 4;
+ ATTR_FALLTHROUGH
/* fallthrough */
case 2: /* .....111 11...... ........ ........ ........ */
r = sldns_wire2str_svcparam_ech2str(s, slen, data_len, *d);
break;
case SVCB_KEY_DOHPATH:
+ ATTR_FALLTHROUGH
/* fallthrough */
default:
r = sldns_str_print(s, slen, "=\"");
break;
case COOKIE_STATUS_CLIENT_ONLY:
edns->cookie_client = 1;
+ ATTR_FALLTHROUGH
/* fallthrough */
case COOKIE_STATUS_FUTURE:
case COOKIE_STATUS_EXPIRED:
case EACCES:
if(verbosity < VERB_ALGO)
return 0;
+ break;
default:
break;
}
break;
#endif /* INET6 */
case AF_UNIX:
+ ATTR_FALLTHROUGH
/* fallthrough */
default:
return 0;
case 7:
b |= ((uint64_t)in[6]) << 48;
/** EDIT annotate case statement fallthrough for gcc */
+ ATTR_FALLTHROUGH
/* fallthrough */
case 6:
b |= ((uint64_t)in[5]) << 40;
/** EDIT annotate case statement fallthrough for gcc */
+ ATTR_FALLTHROUGH
/* fallthrough */
case 5:
b |= ((uint64_t)in[4]) << 32;
/** EDIT annotate case statement fallthrough for gcc */
+ ATTR_FALLTHROUGH
/* fallthrough */
case 4:
b |= ((uint64_t)in[3]) << 24;
/** EDIT annotate case statement fallthrough for gcc */
+ ATTR_FALLTHROUGH
/* fallthrough */
case 3:
b |= ((uint64_t)in[2]) << 16;
/** EDIT annotate case statement fallthrough for gcc */
+ ATTR_FALLTHROUGH
/* fallthrough */
case 2:
b |= ((uint64_t)in[1]) << 8;
/** EDIT annotate case statement fallthrough for gcc */
+ ATTR_FALLTHROUGH
/* fallthrough */
case 1:
b |= ((uint64_t)in[0]);
switch(length) /* all the case statements fall through */
{
case 3 : c+=k[2];
- /* fallthrough */
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 2 : b+=k[1];
- /* fallthrough */
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 1 : a+=k[0];
final(a,b,c);
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 0: /* case 0: nothing left to add */
break;
}
switch(length) /* all the case statements fall through */
{
case 3 : c+=k[2];
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 2 : b+=k[1];
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 1 : a+=k[0];
final(a,b,c);
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 0: /* case 0: nothing left to add */
break;
}
switch(length)
{
case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;
- case 11: c+=((uint32_t)k8[10])<<16; /* fall through */
- case 10: c+=((uint32_t)k8[9])<<8; /* fall through */
- case 9 : c+=k8[8]; /* fall through */
+ case 11: c+=((uint32_t)k8[10])<<16;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
+ case 10: c+=((uint32_t)k8[9])<<8;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
+ case 9 : c+=k8[8];
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 8 : b+=k[1]; a+=k[0]; break;
- case 7 : b+=((uint32_t)k8[6])<<16; /* fall through */
- case 6 : b+=((uint32_t)k8[5])<<8; /* fall through */
- case 5 : b+=k8[4]; /* fall through */
+ case 7 : b+=((uint32_t)k8[6])<<16;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
+ case 6 : b+=((uint32_t)k8[5])<<8;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
+ case 5 : b+=k8[4];
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 4 : a+=k[0]; break;
- case 3 : a+=((uint32_t)k8[2])<<16; /* fall through */
- case 2 : a+=((uint32_t)k8[1])<<8; /* fall through */
+ case 3 : a+=((uint32_t)k8[2])<<16;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
+ case 2 : a+=((uint32_t)k8[1])<<8;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 1 : a+=k8[0]; break;
case 0 : return c;
}
b+=k[2]+(((uint32_t)k[3])<<16);
a+=k[0]+(((uint32_t)k[1])<<16);
break;
- case 11: c+=((uint32_t)k8[10])<<16; /* fall through */
+ case 11: c+=((uint32_t)k8[10])<<16;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 10: c+=k[4];
b+=k[2]+(((uint32_t)k[3])<<16);
a+=k[0]+(((uint32_t)k[1])<<16);
break;
- case 9 : c+=k8[8]; /* fall through */
+ case 9 : c+=k8[8];
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 8 : b+=k[2]+(((uint32_t)k[3])<<16);
a+=k[0]+(((uint32_t)k[1])<<16);
break;
- case 7 : b+=((uint32_t)k8[6])<<16; /* fall through */
+ case 7 : b+=((uint32_t)k8[6])<<16;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 6 : b+=k[2];
a+=k[0]+(((uint32_t)k[1])<<16);
break;
- case 5 : b+=k8[4]; /* fall through */
+ case 5 : b+=k8[4];
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 4 : a+=k[0]+(((uint32_t)k[1])<<16);
break;
- case 3 : a+=((uint32_t)k8[2])<<16; /* fall through */
+ case 3 : a+=((uint32_t)k8[2])<<16;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 2 : a+=k[0];
break;
case 1 : a+=k8[0];
switch(length) /* all the case statements fall through */
{
case 12: c+=((uint32_t)k[11])<<24;
- /* fallthrough */
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 11: c+=((uint32_t)k[10])<<16;
- /* fallthrough */
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 10: c+=((uint32_t)k[9])<<8;
- /* fallthrough */
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 9 : c+=k[8];
- /* fallthrough */
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 8 : b+=((uint32_t)k[7])<<24;
- /* fallthrough */
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 7 : b+=((uint32_t)k[6])<<16;
- /* fallthrough */
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 6 : b+=((uint32_t)k[5])<<8;
- /* fallthrough */
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 5 : b+=k[4];
- /* fallthrough */
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 4 : a+=((uint32_t)k[3])<<24;
- /* fallthrough */
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 3 : a+=((uint32_t)k[2])<<16;
- /* fallthrough */
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 2 : a+=((uint32_t)k[1])<<8;
- /* fallthrough */
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 1 : a+=k[0];
break;
case 0 : return c;
switch(length)
{
case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;
- case 11: c+=((uint32_t)k8[10])<<16; /* fall through */
- case 10: c+=((uint32_t)k8[9])<<8; /* fall through */
- case 9 : c+=k8[8]; /* fall through */
+ case 11: c+=((uint32_t)k8[10])<<16;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
+ case 10: c+=((uint32_t)k8[9])<<8;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
+ case 9 : c+=k8[8];
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 8 : b+=k[1]; a+=k[0]; break;
- case 7 : b+=((uint32_t)k8[6])<<16; /* fall through */
- case 6 : b+=((uint32_t)k8[5])<<8; /* fall through */
- case 5 : b+=k8[4]; /* fall through */
+ case 7 : b+=((uint32_t)k8[6])<<16;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
+ case 6 : b+=((uint32_t)k8[5])<<8;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
+ case 5 : b+=k8[4];
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 4 : a+=k[0]; break;
- case 3 : a+=((uint32_t)k8[2])<<16; /* fall through */
- case 2 : a+=((uint32_t)k8[1])<<8; /* fall through */
+ case 3 : a+=((uint32_t)k8[2])<<16;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
+ case 2 : a+=((uint32_t)k8[1])<<8;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 1 : a+=k8[0]; break;
case 0 : *pc=c; *pb=b; return; /* zero length strings require no mixing */
}
b+=k[2]+(((uint32_t)k[3])<<16);
a+=k[0]+(((uint32_t)k[1])<<16);
break;
- case 11: c+=((uint32_t)k8[10])<<16; /* fall through */
+ case 11: c+=((uint32_t)k8[10])<<16;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 10: c+=k[4];
b+=k[2]+(((uint32_t)k[3])<<16);
a+=k[0]+(((uint32_t)k[1])<<16);
break;
- case 9 : c+=k8[8]; /* fall through */
+ case 9 : c+=k8[8];
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 8 : b+=k[2]+(((uint32_t)k[3])<<16);
a+=k[0]+(((uint32_t)k[1])<<16);
break;
- case 7 : b+=((uint32_t)k8[6])<<16; /* fall through */
+ case 7 : b+=((uint32_t)k8[6])<<16;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 6 : b+=k[2];
a+=k[0]+(((uint32_t)k[1])<<16);
break;
- case 5 : b+=k8[4]; /* fall through */
+ case 5 : b+=k8[4];
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 4 : a+=k[0]+(((uint32_t)k[1])<<16);
break;
- case 3 : a+=((uint32_t)k8[2])<<16; /* fall through */
+ case 3 : a+=((uint32_t)k8[2])<<16;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 2 : a+=k[0];
break;
case 1 : a+=k8[0];
switch(length) /* all the case statements fall through */
{
case 12: c+=((uint32_t)k[11])<<24;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 11: c+=((uint32_t)k[10])<<16;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 10: c+=((uint32_t)k[9])<<8;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 9 : c+=k[8];
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 8 : b+=((uint32_t)k[7])<<24;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 7 : b+=((uint32_t)k[6])<<16;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 6 : b+=((uint32_t)k[5])<<8;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 5 : b+=k[4];
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 4 : a+=((uint32_t)k[3])<<24;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 3 : a+=((uint32_t)k[2])<<16;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 2 : a+=((uint32_t)k[1])<<8;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 1 : a+=k[0];
break;
case 0 : *pc=c; *pb=b; return; /* zero length strings require no mixing */
switch(length) /* all the case statements fall through */
{
case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;
- case 11: c+=((uint32_t)k8[10])<<8; /* fall through */
- case 10: c+=((uint32_t)k8[9])<<16; /* fall through */
- case 9 : c+=((uint32_t)k8[8])<<24; /* fall through */
+ case 11: c+=((uint32_t)k8[10])<<8;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
+ case 10: c+=((uint32_t)k8[9])<<16;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
+ case 9 : c+=((uint32_t)k8[8])<<24;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 8 : b+=k[1]; a+=k[0]; break;
- case 7 : b+=((uint32_t)k8[6])<<8; /* fall through */
- case 6 : b+=((uint32_t)k8[5])<<16; /* fall through */
- case 5 : b+=((uint32_t)k8[4])<<24; /* fall through */
+ case 7 : b+=((uint32_t)k8[6])<<8;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
+ case 6 : b+=((uint32_t)k8[5])<<16;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
+ case 5 : b+=((uint32_t)k8[4])<<24;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 4 : a+=k[0]; break;
- case 3 : a+=((uint32_t)k8[2])<<8; /* fall through */
- case 2 : a+=((uint32_t)k8[1])<<16; /* fall through */
+ case 3 : a+=((uint32_t)k8[2])<<8;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
+ case 2 : a+=((uint32_t)k8[1])<<16;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 1 : a+=((uint32_t)k8[0])<<24; break;
case 0 : return c;
}
switch(length) /* all the case statements fall through */
{
case 12: c+=k[11];
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 11: c+=((uint32_t)k[10])<<8;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 10: c+=((uint32_t)k[9])<<16;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 9 : c+=((uint32_t)k[8])<<24;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 8 : b+=k[7];
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 7 : b+=((uint32_t)k[6])<<8;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 6 : b+=((uint32_t)k[5])<<16;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 5 : b+=((uint32_t)k[4])<<24;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 4 : a+=k[3];
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 3 : a+=((uint32_t)k[2])<<8;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 2 : a+=((uint32_t)k[1])<<16;
+ ATTR_FALLTHROUGH
+ /* fallthrough */
case 1 : a+=((uint32_t)k[0])<<24;
break;
case 0 : return c;
digest_size = (digest_size ? digest_size : SHA1_DIGEST_SIZE);
#endif
/* double fallthrough annotation to please gcc parser */
+ ATTR_FALLTHROUGH
/* fallthrough */
#ifdef USE_SHA2
/* fallthrough */
case LDNS_RSASHA256:
digest_size = (digest_size ? digest_size : SHA256_DIGEST_SIZE);
+ ATTR_FALLTHROUGH
/* fallthrough */
case LDNS_RSASHA512:
digest_size = (digest_size ? digest_size : SHA512_DIGEST_SIZE);
#ifdef USE_ECDSA
case LDNS_ECDSAP256SHA256:
digest_size = (digest_size ? digest_size : SHA256_DIGEST_SIZE);
+ ATTR_FALLTHROUGH
/* fallthrough */
case LDNS_ECDSAP384SHA384:
digest_size = (digest_size ? digest_size : SHA384_DIGEST_SIZE);