From owner-freebsd-hackers@freebsd.org Tue Sep 13 20:45:27 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C2B0BD906C for ; Tue, 13 Sep 2016 20:45:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22a.google.com (mail-it0-x22a.google.com [IPv6:2607:f8b0:4001:c0b::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 264E113DC for ; Tue, 13 Sep 2016 20:45:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22a.google.com with SMTP id o3so14775574ita.1 for ; Tue, 13 Sep 2016 13:45:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=hFeO41one3yiUtGwf2w4APE/C3D/PHR1RxDJm3bArLs=; b=OyGtVUhzXZpIJYcjMF2k/W8yUwnCaKV3Q6gtH93g0lVlh3jZYxooeelH3mqtqo8zZs W45SbUObffDfKXAoCR61qlAhl7LijdC5+umfRo53cOqR+K3B6V2WlMerxcz3IdOnzsdX wND+rcrxAkhOgKfxLE7iyKJAMbxb3Bac0cprr5vsTLRUgX5P/Dw7q3987T8R9R4z/lUm 12NgjVMbuecQahldO8SSNP+7fD8CEFfBsjxfV90GBo5vm5Jgwd2EYTv1idY61HvqsKDk SMu326nEP71fCZu/TlrOj3x8+RmcxAwwE13oS++UjFOPQtA8L0bIBKf0muOpACDuAUgh pQ5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=hFeO41one3yiUtGwf2w4APE/C3D/PHR1RxDJm3bArLs=; b=gMX01SizQqr+9OCTjmcG90fOrm1t1maUNRx7Yuv5cFbq7XpKYFl6RdnpV0xW3glRTh qfZvk9szQI873i4yTAt8dVBgcFE6g/9SY7k7sv1PJsBygjjGkI+M8xTwhRYMk4HFCXkU oH1zOPE/TJVJ7fIbG089OADDnN17ancCe9gz2fj3o8doW57PeiU1XdKYrBIFQv/Kx1d1 5UFqTMebpcI9lz36sZogq8AATGPkcWRvlYth4VCziciYZUJ30FuVp9In6MRZOSY1z+QQ FefwK0Mc/itQK9OSF56qf7e5D0L4CS8ZT6REWMq+Kqvwk8s259VnhylGoa9v2Atp2iz0 YLfA== X-Gm-Message-State: AE9vXwP05ZrM0Z0fypuyjJLxg2NhYpng48jF6SFqEXrWlvLTcBgPW5Ps7OdYuNJUO7A8Qi3iLBJCMTuxApvYXw== X-Received: by 10.107.200.3 with SMTP id y3mr4928568iof.73.1473799526505; Tue, 13 Sep 2016 13:45:26 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.36.65.7 with HTTP; Tue, 13 Sep 2016 13:45:26 -0700 (PDT) X-Originating-IP: [69.53.245.200] In-Reply-To: <7bf5cd37-6436-8cec-74e3-f0856bcc807c@openmailbox.org> References: <7bf5cd37-6436-8cec-74e3-f0856bcc807c@openmailbox.org> From: Warner Losh Date: Tue, 13 Sep 2016 13:45:26 -0700 X-Google-Sender-Auth: 8uMsXQEdK2Pz45r7Q4t5_xNCXzI Message-ID: Subject: Re: What is the point in expression: !!var ? To: twilight Cc: "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Sep 2016 20:45:27 -0000 On Tue, Sep 13, 2016 at 12:54 PM, twilight 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