summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2021-01-19 12:49:22 -0500
committerNick Mathewson <nickm@torproject.org>2021-01-19 12:49:22 -0500
commit4c82c2d1d4a9800f82bcc47c227a8e6a2a0d168d (patch)
tree01485c268d706df11a9e22fa6e137836e8e29497 /src/lib
parent61ee17eb1e3b0c7b92bfa80f3f0f7cbb986db71b (diff)
parenta22bfe04bcb106b14e2416e39dc9f43dc82eeba0 (diff)
downloadtor-4c82c2d1d4a9800f82bcc47c227a8e6a2a0d168d.tar.gz
tor-4c82c2d1d4a9800f82bcc47c227a8e6a2a0d168d.zip
Merge branch 'maint-0.4.3' into maint-0.4.4
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.)