public inbox for [email protected]  
help / color / mirror / Atom feed
From: Thomas Munro <[email protected]>
To: Tom Lane <[email protected]>
Cc: pgsql-hackers <[email protected]>
Subject: Re: Tree-walker callbacks vs -Wdeprecated-non-prototype
Date: Mon, 19 Sep 2022 19:30:09 +1200
Message-ID: <CA+hUKG+bvF0zZ5L-Z9SOHfsYmMJGgVLgSffVvQ1E-aGF6sGYnQ@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CA+hUKGKpHPDTv67Y+s6yiC8KH5OXeDg6a-twWo_xznKTcG0kSA@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<CA+hUKGK=xCw9_V7tCMvpT5D83AH8ArotTw3W4s70Vhqr7VgZkg@mail.gmail.com>
	<[email protected]>
	<CA+hUKGL=dNzs7h85xq1UiHWVRU7+DYrqFkC4J4VZp_s2KD1dMA@mail.gmail.com>
	<[email protected]>

On Mon, Sep 19, 2022 at 4:53 PM Tom Lane <[email protected]> wrote:
> Thomas Munro <[email protected]> writes:
> > On Mon, Sep 19, 2022 at 3:39 PM Tom Lane <[email protected]> wrote:
> >> I also note that our existing code in this area would break pretty
> >> thoroughly on such a machine, so this isn't making it worse.
>
> > Yeah, I don't expect it to be a practical problem on any real system
> > (that is, I don't expect any real calling convention to transfer a
> > struct T * argument in a different place than void *).  I just wanted
> > to mention that it's a new liberty.
>
> No, it's not, because the existing coding here is already assuming that.
> The walker callbacks are generally declared as taking a "struct *"
> second parameter, but expression_tree_walker et al think they are
> passing a "void *" to them.  Even if a platform ABI had some weird
> special rule about how to call functions that you don't know the
> argument list for, it wouldn't fix this because the walkers sure do know
> what their arguments are.  The only reason this code works today is that
> in practice, "void *" *is* ABI-compatible with "struct *".

True.

> I'm not excited about creating a demonstrable opportunity for bugs
> in order to make the code hypothetically more compatible with
> hardware designs that are thirty years obsolete.  (Hypothetical
> in the sense that there's little reason to believe there would
> be no other problems.)

Fair enough.





view thread (19+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Tree-walker callbacks vs -Wdeprecated-non-prototype
  In-Reply-To: <CA+hUKG+bvF0zZ5L-Z9SOHfsYmMJGgVLgSffVvQ1E-aGF6sGYnQ@mail.gmail.com>

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

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