diff options
author | Peter Eisentraut | 2016-08-30 16:00:00 +0000 |
---|---|---|
committer | Peter Eisentraut | 2016-09-30 18:00:44 +0000 |
commit | f1a469c9f1cfeab9f9c7d4a5d3e75892e7b6f60c (patch) | |
tree | 6a2ff1564f11a52dcbd559db784c82b97d3e8fc3 | |
parent | 3d39244e6e7374febff59eba338f7a82f696a618 (diff) |
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 <[email protected]>
Reviewed-by: Thomas Munro <[email protected]>
-rw-r--r-- | contrib/bloom/blutils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/bloom/blutils.c b/contrib/bloom/blutils.c index debf4f46eb7..b68a0d1d0cf 100644 --- a/contrib/bloom/blutils.c +++ b/contrib/bloom/blutils.c @@ -75,7 +75,7 @@ _PG_init(void) bl_relopt_tab[i + 1].optname = MemoryContextStrdup(TopMemoryContext, buf); 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; } } |