Date: Tue, 05 Jun 2018 14:53:24 -0600 From: Ian Lepore <ian@freebsd.org> To: Eric van Gyzen <vangyzen@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334669 - head/sys/sys Message-ID: <1528232004.63685.25.camel@freebsd.org> In-Reply-To: <201806052034.w55KYBsb096418@repo.freebsd.org> References: <201806052034.w55KYBsb096418@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 2018-06-05 at 20:34 +0000, Eric van Gyzen wrote: > Author: vangyzen > Date: Tue Jun 5 20:34:11 2018 > New Revision: 334669 > URL: https://svnweb.freebsd.org/changeset/base/334669 > > Log: > Make Coverity more happy with r334545 > > Coverity complains about: > > if (((flags) & M_WAITOK) || _malloc_item != NULL) > > saying: > > The expression > 1 /* (2 | 0x100) & 2 */ || _malloc_item != NULL > is suspicious because it performs a Boolean operation > on a constant other than 0 or 1. > > Although the code is correct, add "!= 0" to make it slightly > more legible and to silence hundreds(?) of Coverity warnings. > This is a sad sad thing. Treating (bits & flagconstants) as boolean has a long long history in C. Surely there are literally thousand of occurrances in freebsd code already, so why did this one get flagged? -- Ian
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1528232004.63685.25.camel>