Skip to content

Commit f1a469c

Browse files
committed
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>
1 parent 3d39244 commit f1a469c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contrib/bloom/blutils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ _PG_init(void)
7575
bl_relopt_tab[i + 1].optname = MemoryContextStrdup(TopMemoryContext,
7676
buf);
7777
bl_relopt_tab[i + 1].opttype = RELOPT_TYPE_INT;
78-
bl_relopt_tab[i + 1].offset = offsetof(BloomOptions, bitSize[i]);
78+
bl_relopt_tab[i + 1].offset = offsetof(BloomOptions, bitSize[0]) + sizeof(int) * i;
7979
}
8080
}
8181

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy