Re: Expanding the use of FLEXIBLE_ARRAY_MEMBER for declarations like foo[1]

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Expanding the use of FLEXIBLE_ARRAY_MEMBER for declarations like foo[1]
Дата
Msg-id CAB7nPqQrNfWr6ZhGVU=BV2qfccFGOOn=zBjEoJwioPwm8vnyhw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Expanding the use of FLEXIBLE_ARRAY_MEMBER for declarations like foo[1]  (Andres Freund <andres@2ndquadrant.com>)
Ответы Re: Expanding the use of FLEXIBLE_ARRAY_MEMBER for declarations like foo[1]
Re: Expanding the use of FLEXIBLE_ARRAY_MEMBER for declarations like foo[1]
Список pgsql-hackers
On Wed, Feb 18, 2015 at 10:09 PM, Andres Freund <andres@2ndquadrant.com> wrote:
> On 2015-02-18 17:15:18 +0900, Michael Paquier wrote:
>> >> - I don't think that the t_bits fields in htup_details.h should be
>> >> updated either.
>> >
>> > Why not? Any not broken code should already use MinHeapTupleSize and
>> > similar macros.
>>
>> Changing t_bits impacts HeapTupleHeaderData, ReorderBufferTupleBuf and
>> similarly a couple of redo routines in heapam.c using
>> HeapTupleHeaderData in a couple of structures not placing it at the
>> end (compiler complains).
>
> The compiler will complain if you use a FLEXIBLE_ARRAY_MEMBER in the
> middle of a struct but not when when you embed a struct that uses it
> into the middle another struct. At least gcc doesn't and I think it'd be
> utterly broken if another compiler did that. If there's a compiler that
> does so, we need to make it define FLEXIBLE_ARRAY_MEMBER to 1.

clang does complain on my OSX laptop regarding that ;)
-- 
Michael



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Kevin Grittner
Дата:
Сообщение: Re: Allow "snapshot too old" error, to prevent bloat
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Expanding the use of FLEXIBLE_ARRAY_MEMBER for declarations like foo[1]