Re: Removing link-time cross-module refs in contrib

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: Removing link-time cross-module refs in contrib
Дата
Msg-id 20161003183639.fhlcz6zb5ylb3fil@alap3.anarazel.de
обсуждение исходный текст
Ответ на Removing link-time cross-module refs in contrib  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Removing link-time cross-module refs in contrib  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi,

On 2016-10-03 12:29:18 -0400, Tom Lane wrote:
> The patch seems pretty successful in terms of being noninvasive to
> the code.  I think the major objection to it would be that we no
> longer have any direct compiler-verified connection between the
> signatures of the called functions in hstore/plpython and what
> hstore_plpython thinks they are.  That is, if someone were to
> modify hstore and change the signature of say hstoreCheckKeyLen,
> this would not cause any compiler complaints in hstore_plpython,
> just runtime problems.

> A slightly ugly way of alleviating that risk would be to put the
> function typedefs right beside the externs in the originating
> modules, eg in hstore.h
> 
>  extern size_t hstoreCheckKeyLen(size_t len);
> +typedef size_t (*hstoreCheckKeyLen_t) (size_t len);

We could instead add a AssertVariableIsOfType(), besides the library
lookup maybe?


> If we were to push forward with this idea, the remaining work
> would be to fix the other two contrib transform modules similarly,
> after which I would want to revert the changes in commit cac765820
> and later that suppressed linker errors for unresolved symbols in
> contrib links.  The possibility of getting back that error detection
> is actually the main motivation for this IMO.

That'd be rather neat.


Andres



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: pgbench more operators & functions
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Macro customizable hashtable / bitmapscan & aggregation perf