diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2011-06-16 22:39:09 +0300 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2011-06-16 22:45:38 +0300 |
commit | dbbba5279f66f95805c1e084e6f646d174931e56 (patch) | |
tree | eddb454b3d39b17d2e25491d906a6b05b4ea4e18 /src/include/access/gist.h | |
parent | 78475b0ecac4e7793366d2dba0cb875a8fde6bb0 (diff) | |
download | postgresql-dbbba5279f66f95805c1e084e6f646d174931e56.tar.gz postgresql-dbbba5279f66f95805c1e084e6f646d174931e56.zip |
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.h | 2 |
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)) |