RE: err, XLOG/UW711/cc/Doesn't compile.
| От | Peter Eisentraut |
|---|---|
| Тема | RE: err, XLOG/UW711/cc/Doesn't compile. |
| Дата | |
| Msg-id | Pine.LNX.4.21.0011201952210.1090-100000@peter.localdomain обсуждение исходный текст |
| Ответ на | RE: err, XLOG/UW711/cc/Doesn't compile. (Peter Eisentraut <peter_e@gmx.net>) |
| Список | 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@gmx.net http://yi.org/peter-e/
В списке pgsql-hackers по дате отправления: