Force usage of ARGPAR_ASSERT() condition when NDEBUG is defined
This preventive fix is added to prevent future `-Wunused` warnings in
`assert()` statement when building with NDEBUG defined. There are
currently no such warning in the argpar project but there used to be
one. Because the LTTng-Tools project currently (commit
4f002736e) uses
an older argpar version I am seeing this warning:
argpar.c: In function ‘argpar_vasprintf’:
argpar.c:63:12: error: variable ‘len2’ set but not used [-Werror=unused-but-set-variable]
63 | int len1, len2;
Reuse the BT2 approach to force the usage of the assertion condition
even when assert() are removed by the NDEBUG define.
See `BT_USE_EXPR()` macro and documentation in Babeltrace commit[0]:
commit
1778c2a4134647150b199b2b57130817144446b0
Author: Philippe Proulx <eeppeliteloop@gmail.com>
Date: Tue Apr 21 11:15:42 2020 -0400
lib: assign a unique ID to each pre/postcond. and report it on failure
0: https://github.com/efficios/babeltrace/commit/
1778c2a4134647150b199b2b57130817144446b0
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Change-Id: Id71f1f67013cfcf4799ef95a6830babb2dcea973