Date: Sat, 26 May 2018 04:27:25 +0800 From: Marcelo Araujo <araujobsdport@gmail.com> To: "Rodney W. Grimes" <rgrimes@freebsd.org> Cc: Marcelo Araujo <araujo@freebsd.org>, Warner Losh <imp@bsdimp.com>, Ed Maste <emaste@freebsd.org>, src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334199 - head/usr.sbin/bhyve Message-ID: <CAOfEmZj9h6MPYB2JP_zfZep02GK4mH8as9uaTvVDJ=5eH2UNkQ@mail.gmail.com> In-Reply-To: <201805252022.w4PKMdPY047389@pdx.rh.CN85.dnsmgr.net> References: <CAOfEmZiEWLm0ZM8nfT_1rXF%2BiF1=7hAZxMHm5kzAFCjF1F5rVg@mail.gmail.com> <201805252022.w4PKMdPY047389@pdx.rh.CN85.dnsmgr.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, May 26, 2018, 4:22 AM Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > On Sat, May 26, 2018, 4:09 AM Warner Losh <imp@bsdimp.com> wrote: > > > > > > > > > > > On Fri, May 25, 2018 at 2:02 PM, Ed Maste <emaste@freebsd.org> wrote: > > > > > >> On 25 May 2018 at 14:26, Marcelo Araujo <araujobsdport@gmail.com> > wrote: > > >> > > > >> >> The fact that we don't do NDEBUG builds normally does not allow us > to > > >> >> ignore that it exists. It's perfectly reasonable for a user to > build > > >> >> with CFLAGS+=NDEBUG. That need to work. If code is going to fail > to > > >> >> handle resource errors with NDEBUG set then it needs something like > > >> this > > >> >> at the top of the file: > > >> > > > >> > Please document it in some place! > > >> > > >> NDEBUG is documented in assert(3). The man page should have more of an > > >> explanation (and examples) of the possible pitfalls of assert() > > >> though > > >> > > > > > > NDEBUG has been documented in the assert man page since it entered Unix > > > via PBW in the 7th Edition Unix from Bell Labs. It's part of the C > > > standard, as well as many POSIX and SVID docs. > > > > > > > Yes I can read that! Now tell me, do we build FreeBSD without assert? > > > > If we do, probably we can't run it without crash! > > So that makes it perfectly fine to continue what is a well known bad > practice? I do not think so. > > Many people have tried to persuade you that the *proper* way to check > the return from a function is with an if statement, not with an assert, > please try to accept that this is pretty much standard accepted portable > 'C' coding, and realize all those places you see assert(foo) checking > the return of a function are more than likely lurking bugs to be fixed. > I never said that I didn't accepted that! What I have been saying the issue is all around and we need to fix it. Please don't twist my words! Best, > > -- > Rod Grimes > rgrimes@freebsd.org >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOfEmZj9h6MPYB2JP_zfZep02GK4mH8as9uaTvVDJ=5eH2UNkQ>