__attribute__ for non-gcc compilers

Поиск
Список
Период
Сортировка
От Oskari Saarenmaa
Тема __attribute__ for non-gcc compilers
Дата
Msg-id 54B58BA3.8040302@ohmu.fi
обсуждение исходный текст
Ответы Re: __attribute__ for non-gcc compilers  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
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.

/ Oskari

[1] https://docs.oracle.com/cd/E18659_01/html/821-1384/gjzke.html
[2]
http://www-01.ibm.com/support/knowledgecenter/SSGH2K_11.1.0/com.ibm.xlc111.aix.doc/language_ref/var_attrib_aligned.html

Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: EXEC_BACKEND + logging_collector=on is broken
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: pg_basebackup fails with long tablespace paths