Date: Wed, 27 Apr 2022 06:58:54 -0700 From: John Baldwin <jhb@FreeBSD.org> To: Mateusz Guzik <mjg@FreeBSD.org>, src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: b40c0db6f6d6 - main - Patch up __diagused for when only one of INVARIANTS or WITNESS is defined Message-ID: <0dbcc859-69b1-4850-11c3-f8a4acf5bde9@FreeBSD.org> In-Reply-To: <202204271330.23RDUHwN063641@gitrepo.freebsd.org> References: <202204271330.23RDUHwN063641@gitrepo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 4/27/22 6:30 AM, Mateusz Guzik wrote: > The branch main has been updated by mjg: > > URL: https://cgit.FreeBSD.org/src/commit/?id=b40c0db6f6d61ed594118d81dc691b9263a7e4d7 > > commit b40c0db6f6d61ed594118d81dc691b9263a7e4d7 > Author: Mateusz Guzik <mjg@FreeBSD.org> > AuthorDate: 2022-04-27 13:29:12 +0000 > Commit: Mateusz Guzik <mjg@FreeBSD.org> > CommitDate: 2022-04-27 13:29:12 +0000 > > Patch up __diagused for when only one of INVARIANTS or WITNESS is defined > > Reported by: John F Carr<jfc@mit.edu> > --- > sys/sys/systm.h | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/sys/sys/systm.h b/sys/sys/systm.h > index f2ffa7e6b815..6ca9ee886562 100644 > --- a/sys/sys/systm.h > +++ b/sys/sys/systm.h > @@ -554,10 +554,13 @@ void _gone_in_dev(device_t dev, int major, const char *msg); > #define gone_in(major, msg) __gone_ok(major, msg) _gone_in(major, msg) > #define gone_in_dev(dev, major, msg) __gone_ok(major, msg) _gone_in_dev(dev, major, msg) > > -#if defined(INVARIANTS) || defined(WITNESS) > -#define __diagused > -#else > +#if !defined(INVARIANTS) && !defined(WITNESS) > +#define __diagused __unused > +#elif ((defined(INVARIANTS) && !defined(WITNESS)) || \ > + (!defined(INVARIANTS) && defined(WITNESS))) > #define __diagused __unused > +#else > +#define __diagused > #endif Hmm, could this just be: #if defined(INVARIANTS) && defined(WITNESS) #define __diagused #else #define __diagused __unused #endif (That is, just change the || to && in the original version?) -- John Baldwin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0dbcc859-69b1-4850-11c3-f8a4acf5bde9>