AC-Archive
Autoconf Macro Archive

ac-archive.sf.net: - Project CVS - Download
Macro Index
- AM Support
- C++ Support
- C Support
- Fortran Support
- Java Support
- Cross Compilation
- Installed Packages
- Miscellaneous
- LaTeX Support
- Uncategorized
- archive macros
- adl's macros
- bkorb's macros
- guidod's macros
- latex's macros
- other's macros
- rleigh's macros
- obsoleted macros
- released macros
- search index

Documentation
- Contribute!
- History
- acincludedir m4
- acinclude (tool)
- macro howto
- ax tricks
- maintainers
- License
- Topics

generated...
2007-08-05

(C) 2007 guidod
Download the M4 Source.

ax_gcc_warn_unused_result

Back to the Main Page.

Synopsis
AX_GCC_WARN_UNUSED_RESULT ,

defines GCC_WARN_UNUSED_RESULT to __attribute__((__warn_unused_result__)) if ok

Version

2006-08-10

Author

Guido U. Draheim <guidod@gmx.de>

Category

guidod's C Support (released)

Documentation

The macro will compile a test program to see whether the compiler does understand the per-function postfix pragma.

@licence GPLWithACException

M4 Source Code
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
])