pgsql: Rely on inline functions even if that causes warnings in older c

Поиск
Список
Период
Сортировка
От Andres Freund
Тема pgsql: Rely on inline functions even if that causes warnings in older c
Дата
Msg-id E1ZN1VX-00060t-8g@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Rely on inline functions even if that causes warnings in older compilers.

So far we have worked around the fact that some very old compilers do
not support 'inline' functions by only using inline functions
conditionally (or not at all). Since such compilers are very rare by
now, we have decided to rely on inline functions from 9.6 onwards.

To avoid breaking these old compilers inline is defined away when not
supported. That'll cause "function x defined but not used" type of
warnings, but since nobody develops on such compilers anymore that's
ok.

This change in policy will allow us to more easily employ inline
functions.

I chose to remove code previously conditional on PG_USE_INLINE as it
seemed confusing to have code dependent on a define that's always
defined.

Blacklisting of compilers, like in c53f73879f, now has to be done
differently. A platform template can define PG_FORCE_DISABLE_INLINE to
force inline to be defined empty.

Discussion: 20150701161447.GB30708@awork2.anarazel.de

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/de6fd1c898f6eca82c2130a9dbb42d00da68d79e

Modified Files
--------------
config/c-compiler.m4                      |   34 ---------
config/test_quiet_include.h               |   18 -----
configure                                 |   38 -----------
configure.in                              |    2 +-
src/backend/lib/ilist.c                   |    3 -
src/backend/nodes/list.c                  |    3 -
src/backend/port/atomics.c                |    7 --
src/backend/utils/adt/arrayfuncs.c        |    3 -
src/backend/utils/mmgr/mcxt.c             |    3 -
src/backend/utils/sort/sortsupport.c      |    3 -
src/include/access/gin_private.h          |    8 +--
src/include/c.h                           |   42 ++++--------
src/include/lib/ilist.h                   |  106 ++++++++---------------------
src/include/nodes/pg_list.h               |   17 ++---
src/include/pg_config.h.in                |    4 --
src/include/pg_config.h.win32             |    6 +-
src/include/port/atomics.h                |  101 +++++++--------------------
src/include/port/atomics/arch-x86.h       |    4 --
src/include/port/atomics/fallback.h       |    5 --
src/include/port/atomics/generic-acc.h    |   12 +---
src/include/port/atomics/generic-gcc.h    |    8 +--
src/include/port/atomics/generic-msvc.h   |    8 ---
src/include/port/atomics/generic-sunpro.h |    4 --
src/include/port/atomics/generic-xlc.h    |    8 ---
src/include/port/atomics/generic.h        |    4 --
src/include/utils/arrayaccess.h           |   19 +-----
src/include/utils/palloc.h                |   11 +--
src/include/utils/sortsupport.h           |   18 +----
src/template/aix                          |    8 +++
29 files changed, 92 insertions(+), 415 deletions(-)


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

Предыдущее
От: Andres Freund
Дата:
Сообщение: pgsql: Fix debug message output when connecting to a logical slot.
Следующее
От: Andres Freund
Дата:
Сообщение: pgsql: Fix typo in commit de6fd1c.