dnl @synopsis AX_GCC_WARN_UNUSED_RESULT dnl dnl @summary defines GCC_WARN_UNUSED_RESULT to __attribute__((__warn_unused_result__)) if ok dnl dnl The macro will compile a test program to see whether the compiler does dnl understand the per-function postfix pragma. dnl dnl @category C dnl @author Guido U. Draheim dnl @version 2006-08-10 dnl @licence GPLWithACException 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)]) 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__))]) fi ])