Skip site navigation (1) Skip section navigation (2)

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

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Adjust DatumGetBool macro so that it isn't fooled by garbage in
Date: 2008-03-25 19:31:53
Message-ID: 20080325193153.B309A7558E7@cvs.postgresql.org (view raw or flat)
Thread:
Lists: 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:
----
REL7_4_STABLE

Modified Files:
--------------
    pgsql/src/include:
        postgres.h (r1.65 -> r1.65.4.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/postgres.h?r1=1.65&r2=1.65.4.1)

pgsql-committers by date

Next:From: Bruce MomjianDate: 2008-03-25 20:18:18
Subject: pgsql: Done: > * -Avoid tuple some tuple copying in sort routines
Previous:From: Tom LaneDate: 2008-03-25 19:31:46
Subject: pgsql: Adjust DatumGetBool macro so that it isn't fooled by garbage in

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group