Peter Eisentraut <peter_e@gmx.net> writes:
> Is this a route we want to go down?
> - GISTENTRY vector[1]; /* variable-length array */
> + GISTENTRY vector[FLEXIBLE_ARRAY_MEMBER];
Yes, I was thinking about the same trick after noting these warnings on
Fedora 15, although personally I'd name the macro VARIABLE_LENGTH_ARRAY.
> One thing that is a bit concerning is that throwing more flexible array
> members around the code wherever variable-length arrays are used results
> in crash and burn. Probably some places are using sizeof or offsetof on
> these structures in incompatible ways. So each place would have to be
> examined separately.
Hmm, that's nasty. But from a code-documentation standpoint I think
this is a useful improvement, so it seems worth doing the work to clean
things up.
(I do recall a number of places that assume that sizeof() includes a
single array element ...)
regards, tom lane