Bug 212035 - libnv fails to compile on 10.3Stable during buildworld with -DNDEBUG in CFLAGS (low priority)
Summary: libnv fails to compile on 10.3Stable during buildworld with -DNDEBUG in CFLAG...
Status: Closed Works As Intended
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 10.3-STABLE
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-22 02:01 UTC by dewayne
Modified: 2020-11-05 21:43 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dewayne 2016-08-22 02:01:12 UTC
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. :}
Comment 1 dewayne 2020-11-05 21:43:32 UTC
Builds with and without -NDEBUG on FBSD 12.2.