Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 01 Jan 2018 09:30:53 +0000
From:      "Poul-Henning Kamp" <phk@phk.freebsd.dk>
To:        "Rodney W. Grimes" <freebsd-rwg@pdx.rh.CN85.dnsmgr.net>
Cc:        Mark Millard <markmi@dsl-only.net>, FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject:   Re: Is it considered to be ok to not check the return code of close(2) in base?
Message-ID:  <69602.1514799053@critter.freebsd.dk>
In-Reply-To: <201801010305.w0135luG084158@pdx.rh.CN85.dnsmgr.net>
References:  <201801010305.w0135luG084158@pdx.rh.CN85.dnsmgr.net>

next in thread | previous in thread | raw e-mail | index | archive | help
--------
In message <201801010305.w0135luG084158@pdx.rh.CN85.dnsmgr.net>, "Rodney W=
. Gri
mes" writes:

>> Quoting the FreeBSD assert man page:
>> =

>> QUOTE
>>      The assert() macro	may be removed at compile time by defining NDEB=
UG as a
>>      macro (e.g., by using the cc(1) option -DNDEBUG).
>> ENDQUOTE
>> =

>> This makes required-actions inside asserts dangerous,
>> at least without guarantees that NDEBUG will be
>> undefined. Trying to guarantee that NDEBUG will be
>> undefined would generally be a bad idea.

There is a trivial workaround:  Define your own assert() macro.

-- =

Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    =

Never attribute to malice what can adequately be explained by incompetence=
.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69602.1514799053>