Re: pgsql: Remove "fmgr.h" include in cube contrib --- caused crash on a Ge

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: pgsql: Remove "fmgr.h" include in cube contrib --- caused crash on a Ge
Дата
Msg-id 1314977780-sup-3555@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: pgsql: Remove "fmgr.h" include in cube contrib --- caused crash on a Ge  (Bruce Momjian <bruce@momjian.us>)
Ответы Re: pgsql: Remove "fmgr.h" include in cube contrib --- caused crash on a Ge  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-committers
Excerpts from Bruce Momjian's message of vie sep 02 12:20:50 -0300 2011:

> The only other idea I have is to try the attached patch which changes
> the offsetof() call to mention a struct field name, and not the first
> element of the field.  However, I see other uses of accessing the
> element of a struct field, so I might be wrong here.

I wonder if this would be the right time to start using the
FLEXIBLE_ARRAY_MEMBER stuff in contrib/cube.  Note pg_config.h.in says

/* Define to nothing if C supports flexible array members, and to 1 if it does
   not. That way, with a declaration like `struct s { int n; double
   d[FLEXIBLE_ARRAY_MEMBER]; };', the struct hack can be used with pre-C99
   compilers. When computing the size of such an object, don't use 'sizeof
   (struct s)' as it overestimates the size. Use 'offsetof (struct s, d)'
   instead. Don't use 'offsetof (struct s, d[0])', as this doesn't work with
   MSVC and with C++ compilers. */
#undef FLEXIBLE_ARRAY_MEMBER

--
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: pgsql: Remove "fmgr.h" include in cube contrib --- caused crash on a Ge
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pgsql: Remove "fmgr.h" include in cube contrib --- caused crash on a Ge