summaryrefslogtreecommitdiff
path: root/src/include/tsearch
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2015-02-20 17:50:18 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2015-02-20 17:50:18 -0500
commit33b2a2c97f3dd4cf8bbc2c020e34129886367b72 (patch)
tree56580daeff63dca5ea7979769c33d6e9994b59c5 /src/include/tsearch
parent33a3b03d636b529b27f869e332b6344d52635331 (diff)
downloadpostgresql-33b2a2c97f3dd4cf8bbc2c020e34129886367b72.tar.gz
Fix statically allocated struct with FLEXIBLE_ARRAY_MEMBER member.
clang complains about this, not unreasonably, so define another struct that's explicitly for a WordEntryPos with exactly one element. While at it, get rid of pretty dubious use of a static variable for more than one purpose --- if it were being treated as const maybe I'd be okay with this, but it isn't.
Diffstat (limited to 'src/include/tsearch')
-rw-r--r--src/include/tsearch/ts_type.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/include/tsearch/ts_type.h b/src/include/tsearch/ts_type.h
index ce919a2c66..281cdd6c26 100644
--- a/src/include/tsearch/ts_type.h
+++ b/src/include/tsearch/ts_type.h
@@ -66,6 +66,13 @@ typedef struct
WordEntryPos pos[FLEXIBLE_ARRAY_MEMBER];
} WordEntryPosVector;
+/* WordEntryPosVector with exactly 1 entry */
+typedef struct
+{
+ uint16 npos;
+ WordEntryPos pos[1];
+} WordEntryPosVector1;
+
#define WEP_GETWEIGHT(x) ( (x) >> 14 )
#define WEP_GETPOS(x) ( (x) & 0x3fff )