Re: libpq 7.4 and binary cursor - Mailing list pgsql-interfaces

From Tom Lane
Subject Re: libpq 7.4 and binary cursor
Date
Msg-id 25064.1086881965@sss.pgh.pa.us
Whole thread Raw
In response to Re: libpq 7.4 and binary cursor  ("Jeroen T. Vermeulen" <jtv@xs4all.nl>)
Responses Re: libpq 7.4 and binary cursor  ("Jeroen T. Vermeulen" <jtv@xs4all.nl>)
List pgsql-interfaces
"Jeroen T. Vermeulen" <jtv@xs4all.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


pgsql-interfaces by date:

Previous
From: "Jeroen T. Vermeulen"
Date:
Subject: Re: libpq 7.4 and binary cursor
Next
From: "Jeroen T. Vermeulen"
Date:
Subject: Re: libpq 7.4 and binary cursor