pgsql: Fix statically allocated struct with FLEXIBLE_ARRAY_MEMBER membe

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix statically allocated struct with FLEXIBLE_ARRAY_MEMBER membe
Date: 2015-02-20 22:50:23
Message-ID: E1YOwOt-0003WF-Rm@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/33b2a2c97f3dd4cf8bbc2c020e34129886367b72

Modified Files
--------------
src/backend/utils/adt/tsrank.c | 28 +++++++++++++++++-----------
src/include/tsearch/ts_type.h | 7 +++++++
2 files changed, 24 insertions(+), 11 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2015-02-20 22:59:24 Re: pgsql: Use FLEXIBLE_ARRAY_MEMBER in a bunch more places.
Previous Message Tom Lane 2015-02-20 22:32:11 pgsql: Use FLEXIBLE_ARRAY_MEMBER in some more places.