Mitigate impact of cmake defining NDEBUG.

This commit is contained in:
wb2osz 2019-11-08 21:00:12 -05:00
parent d9d6bb4257
commit edafba9fe6
3 changed files with 10 additions and 1 deletions

View File

@ -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);
/*

View File

@ -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

3
xid.c
View File

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