Is it considered to be ok to not check the return code of close(2) in base?

Poul-Henning Kamp phk at phk.freebsd.dk
Mon Jan 1 09:31:13 UTC 2018


--------
In message <201801010305.w0135luG084158 at 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 NDEBUG 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 at 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.


More information about the freebsd-hackers mailing list