pgsql: Adjust DatumGetBool macro so that it isn't fooled by garbage in

Поиск
Список
Период
Сортировка
От tgl@postgresql.org (Tom Lane)
Тема pgsql: Adjust DatumGetBool macro so that it isn't fooled by garbage in
Дата
Msg-id 20080325193140.8A7127558E7@cvs.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Log Message:
-----------
Adjust DatumGetBool macro so that it isn't fooled by garbage in the Datum
to the left of the actual bool value.  While in most cases there won't be
any, our support for old-style user-defined functions violates the C spec
to the extent of calling functions that might return char or short through
a function pointer declared to return "char *", which we then coerce to
Datum.  It is not surprising that the result might contain garbage
high-order bits ... what is surprising is that we didn't see such cases
long ago.  Per report from Magnus.

This is a back-patch of a change that was made in HEAD almost exactly
a year ago.  I had refrained from back-patching at the time, but now
we find that this is *necessary* for contrib to work with gcc 4.3.

Tags:
----
REL8_1_STABLE

Modified Files:
--------------
    pgsql/src/include:
        postgres.h (r1.71 -> r1.71.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/postgres.h?r1=1.71&r2=1.71.2.1)

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

Предыдущее
От: tgl@postgresql.org (Tom Lane)
Дата:
Сообщение: pgsql: Adjust DatumGetBool macro so that it isn't fooled by garbage in
Следующее
От: tgl@postgresql.org (Tom Lane)
Дата:
Сообщение: pgsql: Adjust DatumGetBool macro so that it isn't fooled by garbage in