diff --git a/ax25_pad.c b/ax25_pad.c index b8bdbea..d8af765 100644 --- a/ax25_pad.c +++ b/ax25_pad.c @@ -418,7 +418,8 @@ packet_t ax25_from_text (char *monitor, int strict) this_p->frame_len = 7 + 7 + 1 + 1; this_p->num_addr = (-1); - assert (ax25_get_num_addr(this_p) == 2); + (void) ax25_get_num_addr(this_p); // when num_addr is -1, this sets it properly. + assert (this_p->num_addr == 2); /* diff --git a/direwolf.h b/direwolf.h index 9e32532..6df28ad 100644 --- a/direwolf.h +++ b/direwolf.h @@ -4,6 +4,11 @@ // TODO: include this file first before anything else in each .c file. +#ifdef NDEBUG +#undef NDEBUG // Because it would disable assert(). +#endif + + #ifndef DIREWOLF_H #define DIREWOLF_H 1 diff --git a/xid.c b/xid.c index a96b89a..617720c 100644 --- a/xid.c +++ b/xid.c @@ -665,6 +665,9 @@ int main (int argc, char *argv[]) { text_color_set (DW_COLOR_ERROR); +#ifdef NDEBUG +#error "This won't work properly if NDEBUG is defined. It should be undefined in direwolf.h" +#endif assert (n==1); assert (param.full_duplex == 0); assert (param.srej == srej_single);