mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-30 05:41:29 +02:00
Fix use of offsetof()
Using offsetof() with a run-time computed argument is not allowed in either C or C++. Apparently, gcc allows it, but g++ doesn't. Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi> Reviewed-by: Thomas Munro <thomas.munro@enterprisedb.com>
This commit is contained in:
parent
3d39244e6e
commit
f1a469c9f1
@ -75,7 +75,7 @@ _PG_init(void)
|
|||||||
bl_relopt_tab[i + 1].optname = MemoryContextStrdup(TopMemoryContext,
|
bl_relopt_tab[i + 1].optname = MemoryContextStrdup(TopMemoryContext,
|
||||||
buf);
|
buf);
|
||||||
bl_relopt_tab[i + 1].opttype = RELOPT_TYPE_INT;
|
bl_relopt_tab[i + 1].opttype = RELOPT_TYPE_INT;
|
||||||
bl_relopt_tab[i + 1].offset = offsetof(BloomOptions, bitSize[i]);
|
bl_relopt_tab[i + 1].offset = offsetof(BloomOptions, bitSize[0]) + sizeof(int) * i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user