Content-Length: 259538 | pFad | http://github.com/postgrespro/postgres/commit/f1a469c9f1cfeab9f9c7d4a5d3e75892e7b6f60c

79 Fix use of offsetof() · postgrespro/postgres@f1a469c · GitHub
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)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/f1a469c9f1cfeab9f9c7d4a5d3e75892e7b6f60c

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy