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

From Alvaro Herrera
Subject Re: pgsql: Remove "fmgr.h" include in cube contrib --- caused crash on a Ge
Date
Msg-id 1314977780-sup-3555@alvh.no-ip.org
Whole thread Raw
In response to Re: pgsql: Remove "fmgr.h" include in cube contrib --- caused crash on a Ge  (Bruce Momjian <bruce@momjian.us>)
Responses Re: pgsql: Remove "fmgr.h" include in cube contrib --- caused crash on a Ge
List 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 by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: pgsql: Remove "fmgr.h" include in cube contrib --- caused crash on a Ge
Next
From: Tom Lane
Date:
Subject: Re: pgsql: Remove "fmgr.h" include in cube contrib --- caused crash on a Ge