Date: Tue, 13 Sep 2016 13:45:26 -0700 From: Warner Losh <imp@bsdimp.com> To: twilight <pipfstarrd@openmailbox.org> Cc: "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org> Subject: Re: What is the point in expression: !!var ? Message-ID: <CANCZdfr4F9X4oG8vXgiO5TY9kvTdbzdoqtk_XGwwr-VPwbt2GQ@mail.gmail.com> In-Reply-To: <7bf5cd37-6436-8cec-74e3-f0856bcc807c@openmailbox.org> References: <7bf5cd37-6436-8cec-74e3-f0856bcc807c@openmailbox.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Sep 13, 2016 at 12:54 PM, twilight <pipfstarrd@openmailbox.org> wrote: > c = cond(token, val, yylex(), noeval | !!a); !!foo converts the expression to 0 or 1. Since there's only one | here, it will set the low bit iff a != 0. Without it, it will or in whatever value a has, which may be wrong... Warner
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfr4F9X4oG8vXgiO5TY9kvTdbzdoqtk_XGwwr-VPwbt2GQ>