Re: minor: contrib/btree_gin/btree_gin.c uses DirectFunctionCall3(inet_in, ..)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jon Nelson <jnelson+pgsql(at)jamponi(dot)net>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: minor: contrib/btree_gin/btree_gin.c uses DirectFunctionCall3(inet_in, ..)
Date: 2014-11-14 17:59:18
Message-ID: 31008.1415987958@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Jon Nelson <jnelson+pgsql(at)jamponi(dot)net> writes:
> contrib/btree_gin/btree_gin.c uses DirectFunctionCall3(inet_in,..)
> instead of DirectFunctionCall1(inet_in, one_argument).

> That doesn't seem right. Does such a thing matter?

It's not really incorrect: in a call going through InputFunctionCall(),
which is the normal path, the two extra arguments would be provided
whether the specific datatype input function needed them or not.

However, I think the usual convention for DirectFunctionCall() usage
is to pass exactly what the target function uses, since you know
exactly what you're calling. Certainly that's what happens in the
two direct calls to inet_in in the core code.

So I tend to agree that we should change this call to match the others,
but it's purely cosmetic.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Jon Nelson 2014-11-14 19:12:37 Re: minor: contrib/btree_gin/btree_gin.c uses DirectFunctionCall3(inet_in, ..)
Previous Message Jon Nelson 2014-11-14 16:40:36 minor: contrib/btree_gin/btree_gin.c uses DirectFunctionCall3(inet_in, ..)