mirror of
https://github.com/postgres/postgres.git
synced 2025-08-21 10:42:50 +03:00
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.
This commit is contained in:
@@ -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 )
|
||||
|
Reference in New Issue
Block a user