Peter Geoghegan writes:
Are you proposing that we use the FLEXIBLE_ARRAY_MEMBER macro in every
single place where we currently use the one element array pattern?
Yup, exactly.
I count one place where we currently use FLEXIBLE_ARRAY_MEMBER. It'd be
pretty ugly to have that everywhere, in my opinion.
Hm, I see 4 places in HEAD. But in any case, is

     int16 values[1]; /* VARIABLE LENGTH ARRAY */
} int2vector; /* VARIABLE LENGTH STRUCT */

really better than

     int16 values[FLEXIBLE_ARRAY_MEMBER];
} int2vector;

? I don't think so. Relying on comments to tell about critical
semantics of a data structure isn't really nice if you can do it
in a way that is standards-blessed and (some) compilers understand.

    regards, tom lane

Search Discussions

Discussion Posts


Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 8 of 18 | next ›
Discussion Overview
grouppgsql-hackers @
postedApr 5, '13 at 10:14p
activeJul 23, '13 at 8:30a



site design / logo © 2021 Grokbase