]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Use non-fatal asserts even for regular build
authorOndrej Zajicek (work) <santiago@crfreenet.org>
Wed, 10 Jan 2018 15:17:37 +0000 (16:17 +0100)
committerOndrej Zajicek (work) <santiago@crfreenet.org>
Wed, 10 Jan 2018 15:17:37 +0000 (16:17 +0100)
lib/birdlib.h
nest/proto.c
proto/rpki/ssh_transport.c
proto/rpki/tcp_transport.c

index f41cceb532bef11ab4fc489ec38cc08ede7515e5..428b3209ff8c542ad4c8a1d39de79cfd00c3d776 100644 (file)
@@ -152,9 +152,9 @@ void debug(const char *msg, ...);   /* Printf to debug output */
 #endif
 
 #ifdef DEBUGGING
-#define ASSERT(x) do { if (!(x)) bug("Assertion `%s' failed at %s:%d", #x, __FILE__, __LINE__); } while(0)
+#define ASSERT(x) do { if (!(x)) bug("Assertion '%s' failed at %s:%d", #x, __FILE__, __LINE__); } while(0)
 #else
-#define ASSERT(x) do { } while(0)
+#define ASSERT(x) do { if (!(x)) log(L_BUG "Assertion '%s' failed at %s:%d", #x, __FILE__, __LINE__); } while(0)
 #endif
 
 /* Pseudorandom numbers */
index d584cb9302731f2b8bcac5a3c26b477f43e4efec..15d6f4de6d9d056b77c5bbe3ab49c0ed64da7c67 100644 (file)
@@ -437,7 +437,7 @@ static void
 channel_request_reload(struct channel *c)
 {
   ASSERT(c->channel_state == CS_UP);
-  // ASSERT(channel_reloadable(c));
+  ASSERT(channel_reloadable(c));
 
   c->proto->reload_routes(c);
 
index cd49ab90703f786a5694615a462fd72175bd815a..13e061fc73dd21731a988f43e8d23fcc6f376f9e 100644 (file)
@@ -42,8 +42,6 @@ rpki_tr_ssh_open(struct rpki_tr_sock *tr)
 static const char *
 rpki_tr_ssh_ident(struct rpki_tr_sock *tr)
 {
-  ASSERT(tr != NULL);
-
   struct rpki_cache *cache = tr->cache;
   struct rpki_config *cf = (void *) cache->p->p.cf;
   struct rpki_tr_ssh_config *ssh_cf = (void *) cf->tr_config.spec;
index 6c05964a934ce85d936938678138e5c21a2eae25..0d3c7e99bb5a88ebb74cd3d2f5de57eabc06533e 100644 (file)
@@ -37,8 +37,6 @@ rpki_tr_tcp_open(struct rpki_tr_sock *tr)
 static const char *
 rpki_tr_tcp_ident(struct rpki_tr_sock *tr)
 {
-  ASSERT(tr != NULL);
-
   struct rpki_cache *cache = tr->cache;
   struct rpki_config *cf = (void *) cache->p->p.cf;