Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mGR9r-0004Wz-Lv for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Aug 2021 19:23:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mGR9p-0007o2-18 for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Aug 2021 19:23:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mGR9o-0007nt-PK for pgsql-hackers@lists.postgresql.org; Wed, 18 Aug 2021 19:23:24 +0000 Received: from mail-io1-xd2f.google.com ([2607:f8b0:4864:20::d2f]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mGR9m-0001DM-18 for pgsql-hackers@lists.postgresql.org; Wed, 18 Aug 2021 19:23:24 +0000 Received: by mail-io1-xd2f.google.com with SMTP id q16so4438548ioj.0 for ; Wed, 18 Aug 2021 12:23:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=mKTlFtijNFIoD0OZb+v/6Wk4pqPLe7qqarubC5TXo/U=; b=V0b882STqhlmtGCA6puthJ+32/KZnoaaTcOumZ96dkTMQhGbWT0z1Xh+1Qcj1MLzJv HtOqrR4nKz0jtPzZ6k2/FtvaZZj1CtcQHUKVl57cykmSIPNALycjMehc0rubJpqV51be ViFBTW74jnKDEvms5gj0el1ykNQ8CjKD3TkzB10lhWRiJRSvhW+EmUx68lLx3m31d4dR Lylrsck1ic7slNkoXY2fpEckY47bnDXRC9X+PZaMTf+hwK/TJhXZN/ag4pESqwGksxjH fz7v+j/facWI58Wxmwb79/3xi5sTEoDR5el+tH6pi0bl+OMyoFyaVF7Gv025UTqN9KVU fGpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=mKTlFtijNFIoD0OZb+v/6Wk4pqPLe7qqarubC5TXo/U=; b=r+hU1WAdr5vU8IYu2rprIyPgIa0bfBiW/fpY5uGs2OshZwMst6qh6U2RMFvlpWSVFl XbAw8dGUQV7xFSQ6lEqpROSCOQxHpI6oCzQ+B98wcNm5WqghTinscMaBdxZxNNWxIOHG wLhAeamXw20tlvNb2eRxFAeUgGe2WN/JC4y25L5/uIHSaD2TqK261OnqJ2TEU19J3vTn 76trrKJGehltNqdDaV250IL9sro5UE41xy41xRmUzyfuRvEAbhQdqSHmrBmf7oV7GRoJ h95N4ug0ivR0I3bIdzFABWrZa0nchH2Mc9xIL89BMoTXnjnMx0+uOBk2vspy90nNqD6t W5Ag== X-Gm-Message-State: AOAM5316OrHf9f+1cALUpQaam9s4cAw7bizdDwK9I0M3w6VUV7cMGbWx nf/xS/CzHIl9PVkBA3DlQWz3Z0mXJsqJlQ== X-Google-Smtp-Source: ABdhPJwGSvxoP3smPU5llNvLSPuJYBr/zhKr48T6Jb/deBZIh6vO0zIZeUsgz4QBAfu6S1ErnzmR9w== X-Received: by 2002:a6b:296:: with SMTP id 144mr8284829ioc.114.1629314600183; Wed, 18 Aug 2021 12:23:20 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id k9sm327212ilo.49.2021.08.18.12.23.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Aug 2021 12:23:19 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id A91F2800C5C; Wed, 18 Aug 2021 14:23:18 -0500 (CDT) Date: Wed, 18 Aug 2021 14:23:18 -0500 From: Justin Pryzby To: Bruce Momjian Cc: Tom Lane , pgsql-hackers@lists.postgresql.org Subject: Re: strange case of "if ((a & b))" Message-ID: <20210818192318.GS10479@telsasoft.com> References: <20210428182936.GE27406@telsasoft.com> <2896014.1619635209@sss.pgh.pa.us> <20210625023110.GI29179@telsasoft.com> <20210818180222.GE13002@momjian.us> <20210818182856.GR10479@telsasoft.com> <20210818191521.GG13002@momjian.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210818191521.GG13002@momjian.us> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Aug 18, 2021 at 03:15:21PM -0400, Bruce Momjian wrote: > On Wed, Aug 18, 2021 at 01:28:56PM -0500, Justin Pryzby wrote: > > > > 0002 is a bonus patch I found in my typos branch. I will hold onto it for > > > > later if nobody wants to deal with it. > > > > > > I am ready to deal with this patch. Should I apply it to master soon? > > > > Thanks for looking at it. I suggest not to apply 0002 - I'll resend it on > > another thread with other, similar cleanups. > > OK. > > > However, I have another patch to clean up stuff like "? true : false", which > > seems related to this patch (but maybe it should be applied separately). > > Yes, that is odd. I think it is related to the confusion that if () > compares non-zero(true) and zero(false), while booleans return only 1/0 > (no other values). This explores that: > > https://stackoverflow.com/questions/22489517/c-language-boolean-expression-return-value > > Do you want me to consider this patch now? Yes, please. It may be helpful to dispose of the first patch first. Thanks, Justin