0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 01:31:55 +00:00

Use non-fatal asserts even for regular build

This commit is contained in:
Ondrej Zajicek (work) 2018-01-10 16:17:37 +01:00
parent 72163bd5f3
commit 2e507a7457
4 changed files with 3 additions and 7 deletions

View 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 */

View 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);

View 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;

View 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;