diff options
author | Peter Kokot <peterkokot@gmail.com> | 2018-07-27 09:18:17 +0200 |
---|---|---|
committer | Peter Kokot <peterkokot@gmail.com> | 2018-07-27 18:35:29 +0200 |
commit | b26684dc2f29222d9581089ea8cfb2fc54319fb4 (patch) | |
tree | fc9b3a24381315e755f7d3d965634c2a74875cfd /m4/ax_gcc_warn_unused_result.m4 | |
parent | 68e93457f1d6f73f8e5019e7a0a97851085dc0fa (diff) | |
download | autoconf-archive-b26684dc2f29222d9581089ea8cfb2fc54319fb4.tar.gz |
Replace obsolete AC_TRY_COMPILE with AC_COMPILE_IFELSE
Autoconf made several macros obsolete including the AC_TRY_COMPILE in
2000 and since Autoconf 2.50:
http://git.savannah.gnu.org/cgit/autoconf.git/tree/ChangeLog.2
These macros should be replaced with the current AC_COMPILE_IFELSE
instead.
Refs:
- https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html
- https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/AC_005fACT_005fIFELSE-vs-AC_005fTRY_005fACT.html
Diffstat (limited to 'm4/ax_gcc_warn_unused_result.m4')
-rw-r--r-- | m4/ax_gcc_warn_unused_result.m4 | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/m4/ax_gcc_warn_unused_result.m4 b/m4/ax_gcc_warn_unused_result.m4 index 00aeeff..9a190e2 100644 --- a/m4/ax_gcc_warn_unused_result.m4 +++ b/m4/ax_gcc_warn_unused_result.m4 @@ -20,16 +20,16 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 9 +#serial 10 AC_DEFUN([AX_GCC_WARN_UNUSED_RESULT],[dnl AC_CACHE_CHECK( [whether the compiler supports function __attribute__((__warn_unused_result__))], ax_cv_gcc_warn_unused_result,[ - AC_TRY_COMPILE([__attribute__((__warn_unused_result__)) - int f(int i) { return i; }], - [], - ax_cv_gcc_warn_unused_result=yes, ax_cv_gcc_warn_unused_result=no)]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[__attribute__((__warn_unused_result__)) + int f(int i) { return i; }]], + [])], + [ax_cv_gcc_warn_unused_result=yes], [ax_cv_gcc_warn_unused_result=no])]) if test "$ax_cv_gcc_warn_unused_result" = yes; then AC_DEFINE([GCC_WARN_UNUSED_RESULT],[__attribute__((__warn_unused_result__))], [most gcc compilers know a function __attribute__((__warn_unused_result__))]) |