]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Disallow NDEBUG. It is very stupid.
authorNick Mathewson <nickm@torproject.org>
Mon, 29 Nov 2004 07:22:57 +0000 (07:22 +0000)
committerNick Mathewson <nickm@torproject.org>
Mon, 29 Nov 2004 07:22:57 +0000 (07:22 +0000)
svn:r3012

src/common/util.h

index e2a7546de10a7f2bd0b8b8dfac2a6d266e7dbd20..977425db571a6e5a24a42a220fcce3fc940dfc1c 100644 (file)
  * calling assert() normally.
  */
 #ifdef NDEBUG
-#define tor_assert(expr) do {} while (0)
+/* Nobody should ever want to build with NDEBUG set.  99% of your asserts will
+ * be outside the critical path anyway, so it's silly to disable bugchecking
+ * throughout the entire program just because a few asserts are slowing you
+ * down.  Profile, optimize the critical path, and keep debugging on.
+ *
+ * And I'm not just saying that because some of our asserts check
+ * security-critical properties.
+ */
+#error "Sorry; we don't support building with NDEBUG."
 #else
 #define tor_assert(expr) do {                                 \
  if (!(expr)) {                                               \