I wrote:

> Mikheev, Vadim writes:
> 
> > > more info.  It seems to not like the following from
> > > src/include/buffer/bufpage.h (line 305):
> > > #define PageSetLSN(page, lsn) \
> > >         (((PageHeader) (page))->pd_lsn = (XLogRecPtr) (lsn))
> > > 
> > > I'm not sure what it's trying to do... 
> > 
> > Just assign values to 8 bytes structure in pageheader.
> 
> It's because XLogRecPtr is a struct.  You can't assign structs with
> '='.  Gotta use memcpy, etc.

Correction:  It's because the compiler won't let you cast to a
struct.  Assigning seems to compile okay.

This code fails to compile:

| typedef struct foo { int a; int b; } foo;
| 
| main() {
|   foo x;
|   (foo) x;
| }

-- 
Peter Eisentraut      [EMAIL PROTECTED]       http://yi.org/peter-e/

Reply via email to