| From: | Peter Eisentraut <peter_e(at)gmx(dot)net> |
|---|---|
| To: | "Mikheev, Vadim" <vmikheev(at)SECTORBASE(dot)COM> |
| Cc: | "'Larry Rosenman'" <ler(at)lerctr(dot)org>, PostgreSQL Hackers List <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | RE: err, XLOG/UW711/cc/Doesn't compile. |
| Date: | 2000-11-20 18:58:27 |
| Message-ID: | Pine.LNX.4.21.0011201952210.1090-100000@peter.localdomain |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
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 peter_e(at)gmx(dot)net http://yi.org/peter-e/
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Mikheev, Vadim | 2000-11-20 19:12:18 | RE: err, XLOG/UW711/cc/Doesn't compile. |
| Previous Message | Tom Lane | 2000-11-20 18:58:10 | Re: err, XLOG/UW711/cc/Doesn't compile. |