Re: datum passed to macro which expects a pointer - Mailing list pgsql-patches

From Tom Lane
Subject Re: datum passed to macro which expects a pointer
Date
Msg-id 25542.1208037759@sss.pgh.pa.us
Whole thread Raw
In response to datum passed to macro which expects a pointer  (Gavin Sherry <swm@alcove.com.au>)
Responses Re: datum passed to macro which expects a pointer  (Gavin Sherry <swm@alcove.com.au>)
List pgsql-patches
Gavin Sherry <swm@alcove.com.au> writes:
> This may seem a little pedantic but I noticed a few places where we pass
> a datum to a macro which treats the datum as a pointer. This works now
> but might not in the future (if, say, Datum were to be 8 bytes).

Yeah, definitely something to fix.  I think though that the cases
like this:

> !     PG_RETURN_TEXT_P(DatumGetPointer(result));

might as well just use PG_RETURN_DATUM instead of casting twice.

Was this just eyeball inspection or did you find a compiler that would
complain about this?

            regards, tom lane

pgsql-patches by date:

Previous
From: Gavin Sherry
Date:
Subject: datum passed to macro which expects a pointer
Next
From: Gavin Sherry
Date:
Subject: Re: datum passed to macro which expects a pointer