aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2021-01-19 12:49:31 -0500
committerNick Mathewson <nickm@torproject.org>2021-01-19 12:49:31 -0500
commit6c1bc570cf49c8e493d3278fefaf0c77e289f82c (patch)
tree834e9e5b019f6daba7c2a963ff4184cedad9fe55
parentf79a31f6d50b6b44e0bef091f3e6df0d473141bd (diff)
parent4c82c2d1d4a9800f82bcc47c227a8e6a2a0d168d (diff)
downloadtor-6c1bc570cf49c8e493d3278fefaf0c77e289f82c.tar.gz
tor-6c1bc570cf49c8e493d3278fefaf0c77e289f82c.zip
Merge branch 'maint-0.4.4' into maint-0.4.5
-rw-r--r--changes/40241_v24
-rw-r--r--src/core/or/channeltls.c4
-rw-r--r--src/core/or/circuitlist.c4
-rw-r--r--src/feature/client/entrynodes.c4
-rw-r--r--src/feature/rend/rendclient.c4
-rw-r--r--src/lib/log/util_bug.h11
6 files changed, 19 insertions, 12 deletions
diff --git a/changes/40241_v2 b/changes/40241_v2
new file mode 100644
index 0000000000..85038297f7
--- /dev/null
+++ b/changes/40241_v2
@@ -0,0 +1,4 @@
+ o Minor bugfixes (compilation):
+ - Fix another warning about unreachable fallthrough annotations
+ when building with "--enable-all-bugs-are-fatal" on some compilers.
+ Fixes bug 40241; bugfix on 0.4.5.3-rc.
diff --git a/src/core/or/channeltls.c b/src/core/or/channeltls.c
index 846e6e5f42..dd5e42c47f 100644
--- a/src/core/or/channeltls.c
+++ b/src/core/or/channeltls.c
@@ -1248,9 +1248,7 @@ channel_tls_handle_var_cell(var_cell_t *var_cell, or_connection_t *conn)
* the v2 and v3 handshakes. */
/* But that should be happening any longer've disabled bufferevents. */
tor_assert_nonfatal_unreached_once();
-#ifndef ALL_BUGS_ARE_FATAL
- FALLTHROUGH;
-#endif
+ FALLTHROUGH_UNLESS_ALL_BUGS_ARE_FATAL;
case OR_CONN_STATE_TLS_SERVER_RENEGOTIATING:
if (!(command_allowed_before_handshake(var_cell->command))) {
log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL,
diff --git a/src/core/or/circuitlist.c b/src/core/or/circuitlist.c
index a912b267da..bd36683880 100644
--- a/src/core/or/circuitlist.c
+++ b/src/core/or/circuitlist.c
@@ -851,9 +851,7 @@ circuit_purpose_to_controller_hs_state_string(uint8_t purpose)
"Unrecognized circuit purpose: %d",
(int)purpose);
tor_fragile_assert();
-#ifndef ALL_BUGS_ARE_FATAL
- FALLTHROUGH;
-#endif
+ FALLTHROUGH_UNLESS_ALL_BUGS_ARE_FATAL;
case CIRCUIT_PURPOSE_OR:
case CIRCUIT_PURPOSE_C_GENERAL:
diff --git a/src/feature/client/entrynodes.c b/src/feature/client/entrynodes.c
index 9da1c259b4..82866ea668 100644
--- a/src/feature/client/entrynodes.c
+++ b/src/feature/client/entrynodes.c
@@ -2317,9 +2317,7 @@ entry_guards_note_guard_success(guard_selection_t *gs,
break;
default:
tor_assert_nonfatal_unreached();
-#ifndef ALL_BUGS_ARE_FATAL
- FALLTHROUGH;
-#endif
+ FALLTHROUGH_UNLESS_ALL_BUGS_ARE_FATAL;
case GUARD_CIRC_STATE_USABLE_IF_NO_BETTER_GUARD:
if (guard->is_primary) {
/* XXXX #20832 -- I don't actually like this logic. It seems to make
diff --git a/src/feature/rend/rendclient.c b/src/feature/rend/rendclient.c
index 71eeb8a6ec..3dda7cd46d 100644
--- a/src/feature/rend/rendclient.c
+++ b/src/feature/rend/rendclient.c
@@ -838,9 +838,7 @@ rend_client_report_intro_point_failure(extend_info_t *failed_intro,
log_warn(LD_BUG, "Unknown failure type %u. Removing intro point.",
failure_type);
tor_fragile_assert();
-#ifndef ALL_BUGS_ARE_FATAL
- FALLTHROUGH;
-#endif
+ FALLTHROUGH_UNLESS_ALL_BUGS_ARE_FATAL;
case INTRO_POINT_FAILURE_GENERIC:
rend_cache_intro_failure_note(failure_type,
(uint8_t *)failed_intro->identity_digest,
diff --git a/src/lib/log/util_bug.h b/src/lib/log/util_bug.h
index 6b27b36f03..684dc7c6dd 100644
--- a/src/lib/log/util_bug.h
+++ b/src/lib/log/util_bug.h
@@ -249,6 +249,17 @@
#endif /* defined(ALL_BUGS_ARE_FATAL) || ... */
+/**
+ * Use this macro after a nonfatal assertion, and before a case statement
+ * where you would want to fall through.
+ */
+#ifdef ALL_BUGS_ARE_FATAL
+#define FALLTHROUGH_UNLESS_ALL_BUGS_ARE_FATAL \
+ abort()
+#else
+#define FALLTHROUGH_UNLESS_ALL_BUGS_ARE_FATAL FALLTHROUGH
+#endif
+
/** In older code, we used tor_fragile_assert() to mark optional failure
* points. At these points, we could make some debug builds fail.
* (But release builds would continue.)