Re: [HACKERS] cast result of copyNode() - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] cast result of copyNode()
Date
Msg-id 10066.1488929655@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] cast result of copyNode()  (Mark Dilger <hornschnorter@gmail.com>)
List pgsql-hackers
Mark Dilger <hornschnorter@gmail.com> writes:
> You appear to be using a #define macro to wrap a function of the same name
> with the code:

> #define copyObject(obj) ((typeof(obj)) copyObject(obj))

> I don't necessarily have a problem with that, but it struck me as a bit odd, and
> grep'ing through the sources, I don't see anywhere else in the project where that
> is done for a function of the same number of arguments, and only one other
> place where it is done at all:

I agree that that seems like a bad idea.  Better to rename the underlying
function --- for one thing, that provides an "out" if some caller doesn't
want this behavior.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: [HACKERS] Proposal for changes to recovery.conf API
Next
From: Robert Haas
Date:
Subject: Re: [HACKERS] Write Ahead Logging for Hash Indexes