Re: Back branches vs. gcc 4.8.0 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Back branches vs. gcc 4.8.0
Date
Msg-id 15087.1365202206@sss.pgh.pa.us
Whole thread Raw
In response to Re: Back branches vs. gcc 4.8.0  (Peter Geoghegan <pg@heroku.com>)
Responses Re: Back branches vs. gcc 4.8.0
List pgsql-hackers
Peter Geoghegan <pg@heroku.com> 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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Back branches vs. gcc 4.8.0
Next
From: Peter Geoghegan
Date:
Subject: Re: Back branches vs. gcc 4.8.0