Re: __attribute__ for non-gcc compilers

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: __attribute__ for non-gcc compilers
Дата
Msg-id CA+TgmoYpRE+exuMU9eGkYu43KrAHpt0UhHs3=ogcKJeKQ7CCZQ@mail.gmail.com
обсуждение исходный текст
Ответ на __attribute__ for non-gcc compilers  (Oskari Saarenmaa <os@ohmu.fi>)
Ответы Re: __attribute__ for non-gcc compilers  (Andres Freund <andres@2ndquadrant.com>)
Список pgsql-hackers
On Tue, Jan 13, 2015 at 4:18 PM, Oskari Saarenmaa <os@ohmu.fi> wrote:
> Commit db4ec2ffce35 added alignment attributes for 64-bit atomic
> variables as required on 32-bit platforms using
> __attribute__((aligned(8)).  That works fine with GCC, and would work
> with Solaris Studio Compiler [1] and IBM XL C [2], but src/include/c.h
> defines __attribute__ as an empty macro when not using GCC.
> Unfortunately we can't just disable that #define and enable all
> __attributes__ for Solaris CC and XLC as we use a bunch of attributes
> that are not supported by those compilers and using them unconditionally
> would generate a lot of warnings.
>
> Attached a patch that defines custom macros for each attribute and
> enables them individually for compilers that support them and never
> defines __attribute__.
>
> I have tested this with GCC 4.9.2 on Linux x86-64 and Solaris CC 5.12 on
> Sparc (32-bit build); I don't have access to an IBM box with XLC.

I guess my first question is whether we want to be relying on
__attribute__((aligned)) in the first place.  If we do, then this
seems like a pretty sensible and necessary change.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: hung backends stuck in spinlock heavy endless loop
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Safe memory allocation functions