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

Re: libpq 7.4 and binary cursor

From: "Jeroen T(dot) Vermeulen" <jtv(at)xs4all(dot)nl>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Stephane Raimbault <stephane(dot)raimbault(at)free(dot)fr>,pgsql-interfaces(at)postgresql(dot)org
Subject: Re: libpq 7.4 and binary cursor
Date: 2004-06-10 16:58:51
Message-ID: 20040610165850.GB28191@xs4all.nl (view raw or flat)
Thread:
Lists: pgsql-interfaces
On Thu, Jun 10, 2004 at 11:39:25AM -0400, Tom Lane wrote:
 
> Nonsense.  C99 6.7.2.1:
> 
>        A pointer  to  a  union  object, suitably converted, points to
>        each of its members (or if a member is a bit-field, then  to
>        the unit in which it resides), and vice versa.
> 
> It does say that the results of fetching a union member other than
> the one last stored to are implementation-dependent, but not that
> the implementation can choose to put them in different places.

I stand corrected.  Perhaps this is something that changed in C99 because
too many programs used this trick, or because enough platforms supported 
it.

Note, however, that this is about pointers to unions (and ``suitably
converted,'' whatever that means; there are cases where pointer type
conversions may involve the addition or subtraction of an offset, so there
are situations where you need to be careful about how exactly you convert
your pointers).  The code we're talking about had a union object, but no
pointers.  So the part about registerization still holds.


Jeroen


In response to

pgsql-interfaces by date

Next:From: Terry Lee TuckerDate: 2004-06-10 18:09:13
Subject: Locking Question
Previous:From: Tom LaneDate: 2004-06-10 15:39:25
Subject: Re: libpq 7.4 and binary cursor

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