Commit f1a469c9 authored by Peter Eisentraut's avatar Peter Eisentraut

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: default avatarHeikki Linnakangas <hlinnaka@iki.fi>
Reviewed-by: default avatarThomas Munro <thomas.munro@enterprisedb.com>
parent 3d39244e
...@@ -75,7 +75,7 @@ _PG_init(void) ...@@ -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;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment