pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeroen T. Vermeulen <jtv@xs4all.nl>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Stephane Raimbault <stephane.raimbault@free.fr>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: libpq 7.4 and binary cursor
Date: Thu, 10 Jun 2004 18:58:51 +0200
Message-ID: <20040610165850.GB28191@xs4all.nl> (raw)
In-Reply-To: <25064.1086881965@sss.pgh.pa.us>
References: <1086877827.4646.22.camel@picasso.lan>
	<20040610150411.GD27490@xs4all.nl>
	<25064.1086881965@sss.pgh.pa.us>

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




view thread (5+ messages)  latest in thread

Message-ID: <20040610165850.GB28191@xs4all.nl>
Permalink:  ../20040610165850.GB28191@xs4all.nl/
Also on:    postgresql.org/message-id/20040610165850.GB28191@xs4all.nl

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: jtv@xs4all.nl, tgl@sss.pgh.pa.us, stephane.raimbault@free.fr
  Subject: Re: libpq 7.4 and binary cursor
  In-Reply-To: <20040610165850.GB28191@xs4all.nl>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox