aboutsummaryrefslogtreecommitdiff
path: root/src/lib
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 /src/lib
parentf79a31f6d50b6b44e0bef091f3e6df0d473141bd (diff)
parent4c82c2d1d4a9800f82bcc47c227a8e6a2a0d168d (diff)
downloadtor-6c1bc570cf49c8e493d3278fefaf0c77e289f82c.tar.gz
tor-6c1bc570cf49c8e493d3278fefaf0c77e289f82c.zip
Merge branch 'maint-0.4.4' into maint-0.4.5
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/log/util_bug.h11
1 files changed, 11 insertions, 0 deletions
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.)