Defining NDEBUG on the CFLAGS variable inhibits compilation of libnv as follows: # cd /pd3/src; MAKEOBJDIRPREFIX=/usr/obj/pd3/src/tmp cc -fpic -DPIC -O2 -pipe -g0 -ggdb0 -DNDEBUG -DSTRIP_FBSDID -UDEBUGGING -UDEBUG -DUSB_HAVE_DISABLE_ENUM -march=core-avx-i -I/pd3/src/lib/libnv/../../sys -I/pd3/src/lib/libnv -std=gnu99 -Qunused-arguments -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wmissing-variable-declarations -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -c /pd3/src/lib/libnv/../../sys/kern/subr_nvlist.c -o subr_nvlist.So /pd3/src/lib/libnv/../../sys/kern/subr_nvlist.c:982:36: error: unused parameter 'nvl' [-Werror,-Wunused-parameter] nvlist_next_nvpair(const nvlist_t *nvl, const nvpair_t *nvp) ^ /pd3/src/lib/libnv/../../sys/kern/subr_nvlist.c:998:36: error: unused parameter 'nvl' [-Werror,-Wunused-parameter] nvlist_prev_nvpair(const nvlist_t *nvl, const nvpair_t *nvp) --------- Whereas same comand without NDEBUG produces an object file. Discovered while trying to build a world without DEBUG code, and inadvertently -DNDEBUG when I should -UDEBUG. :}
Builds with and without -NDEBUG on FBSD 12.2.