pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Justin Pryzby <pryzby@telsasoft.com>
To: Bruce Momjian <bruce@momjian.us>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: strange case of "if ((a & b))"
Date: Wed, 18 Aug 2021 14:23:18 -0500
Message-ID: <20210818192318.GS10479@telsasoft.com> (raw)
In-Reply-To: <20210818191521.GG13002@momjian.us>
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>

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





view thread (27+ messages)  latest in thread

Message-ID: <20210818192318.GS10479@telsasoft.com>
Permalink:  ../20210818192318.GS10479@telsasoft.com/
Also on:    postgresql.org/message-id/20210818192318.GS10479@telsasoft.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: pryzby@telsasoft.com, bruce@momjian.us, tgl@sss.pgh.pa.us, pgsql-hackers@lists.postgresql.org
  Subject: Re: strange case of "if ((a & b))"
  In-Reply-To: <20210818192318.GS10479@telsasoft.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox