aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2016-08-30 12:00:00 -0400
committerPeter Eisentraut <peter_e@gmx.net>2016-09-30 14:00:44 -0400
commitf1a469c9f1cfeab9f9c7d4a5d3e75892e7b6f60c (patch)
tree6a2ff1564f11a52dcbd559db784c82b97d3e8fc3
parent3d39244e6e7374febff59eba338f7a82f696a618 (diff)
downloadpostgresql-f1a469c9f1cfeab9f9c7d4a5d3e75892e7b6f60c.tar.gz
postgresql-f1a469c9f1cfeab9f9c7d4a5d3e75892e7b6f60c.zip
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>
-rw-r--r--contrib/bloom/blutils.c2
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;
}
}