1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-11 20:28:21 +03:00

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
This commit is contained in:
Andres Freund
2015-08-05 18:19:52 +02:00
parent a855118be3
commit de6fd1c898
29 changed files with 92 additions and 415 deletions

38
configure vendored
View File

@ -11006,44 +11006,6 @@ _ACEOF
;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for quiet inline (no complaint if unreferenced)" >&5
$as_echo_n "checking for quiet inline (no complaint if unreferenced)... " >&6; }
if ${pgac_cv_c_inline_quietly+:} false; then :
$as_echo_n "(cached) " >&6
else
pgac_cv_c_inline_quietly=no
if test "$ac_cv_c_inline" != no; then
pgac_c_inline_save_werror=$ac_c_werror_flag
ac_c_werror_flag=yes
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include "$srcdir/config/test_quiet_include.h"
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
pgac_cv_c_inline_quietly=yes
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
ac_c_werror_flag=$pgac_c_inline_save_werror
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_c_inline_quietly" >&5
$as_echo "$pgac_cv_c_inline_quietly" >&6; }
if test "$pgac_cv_c_inline_quietly" != no; then
cat >>confdefs.h <<_ACEOF
#define PG_USE_INLINE 1
_ACEOF
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for printf format archetype" >&5
$as_echo_n "checking for printf format archetype... " >&6; }
if ${pgac_cv_printf_archetype+:} false; then :