summaryrefslogtreecommitdiff
path: root/src/include/access/gist.h
diff options
context:
space:
mode:
authorPeter Eisentraut2011-06-16 19:39:09 +0000
committerPeter Eisentraut2011-06-16 19:45:38 +0000
commitdbbba5279f66f95805c1e084e6f646d174931e56 (patch)
treeeddb454b3d39b17d2e25491d906a6b05b4ea4e18 /src/include/access/gist.h
parent78475b0ecac4e7793366d2dba0cb875a8fde6bb0 (diff)
Start using flexible array members
Flexible array members are a C99 feature that avoids "cheating" in the declaration of variable-length arrays at the end of structs. With Autoconf support, this should be transparent for older compilers. We start with one use in gist.h because gcc 4.6 started to raise a warning there. Over time, it can be expanded to other places in the source, but they will likely need some review of sizeof and offsetof usage. The current change in gist.h appears to be safe in this regard.
Diffstat (limited to 'src/include/access/gist.h')
-rw-r--r--src/include/access/gist.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/include/access/gist.h b/src/include/access/gist.h
index df9f39c7b89..5ce7325ff9b 100644
--- a/src/include/access/gist.h
+++ b/src/include/access/gist.h
@@ -144,7 +144,7 @@ typedef struct GISTENTRY
typedef struct
{
int32 n; /* number of elements */
- GISTENTRY vector[1]; /* variable-length array */
+ GISTENTRY vector[FLEXIBLE_ARRAY_MEMBER];
} GistEntryVector;
#define GEVHDRSZ (offsetof(GistEntryVector, vector))