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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-interfaces by date

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