Re: datum passed to macro which expects a pointer

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gavin Sherry <swm(at)alcove(dot)com(dot)au>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: datum passed to macro which expects a pointer
Date: 2008-04-12 22:02:39
Message-ID: 25542.1208037759@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Gavin Sherry <swm(at)alcove(dot)com(dot)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

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Gavin Sherry 2008-04-12 22:57:55 Re: datum passed to macro which expects a pointer
Previous Message Gavin Sherry 2008-04-12 21:38:13 datum passed to macro which expects a pointer