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

Re: libpq 7.4 and binary cursor

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Jeroen T(dot) Vermeulen" <jtv(at)xs4all(dot)nl>
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 15:39:25
Message-ID: 25064.1086881965@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-interfaces
"Jeroen T. Vermeulen" <jtv(at)xs4all(dot)nl> writes:
> This trick may work on some compilers and/or platforms, but it's not
> correct C.  The language does not guarantee that the members of a union
> will be allocated in the exact same address, or even that they will
> overlap.

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.

			regards, tom lane

In response to

Responses

pgsql-interfaces by date

Next:From: Jeroen T. VermeulenDate: 2004-06-10 16:58:51
Subject: Re: libpq 7.4 and binary cursor
Previous:From: Jeroen T. VermeulenDate: 2004-06-10 15:04:12
Subject: Re: libpq 7.4 and binary cursor

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