Re: What about a castNode() macro?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: What about a castNode() macro?
Date: 2014-04-29 17:32:50
Message-ID: 9403.1398792770@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> There's a repeated pattern of

> Assert(IsA(ptr, nodetype));
> foo = (nodetype *) ptr;

> how about adding a castNode() that combines those?

Doesn't really seem worth it. The notational advantage is not great,
and to the extent that it were to touch a lot of places, the main outcome
would be pain for back-patching.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2014-04-29 17:37:03 Re: pg_dump --pretty-print-views
Previous Message Keith Fiske 2014-04-29 17:29:22 Re: pg_dump --pretty-print-views