Commit a303d283 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(CMOD_C_ATTRIBUTE_UNUSED): Removed.

(CMOD_C_WORKING_ATTRIBUTE_UNUSED): New defun.
parent a28695b4
dnl $Id: acinclude.m4,v 1.8 2002/10/02 07:23:06 ceder Exp $
dnl $Id: acinclude.m4,v 1.9 2002/12/29 23:30:07 ceder Exp $
dnl Copyright (C) 1994-1995, 1998-1999, 2001-2002 Lysator Academic Computer Association.
dnl
dnl This file is part of the LysKOM server.
......@@ -44,15 +44,22 @@ fi])dnl
dnl
dnl Another frozen defun.
dnl
AC_DEFUN(CMOD_C_ATTRIBUTE_UNUSED,
[AC_MSG_CHECKING([whether $CC understands __attribute__((unused))])
AC_CACHE_VAL([cmod_cv_c_attribute_unused_understood],
AC_TRY_COMPILE([int foo(int *i __attribute__((unused))) { *i = 4711; }],
[int i __attribute__((unused));],
[cmod_cv_c_attribute_unused_understood=yes],
[cmod_cv_c_attribute_unused_understood=no]))
AC_MSG_RESULT($cmod_cv_c_attribute_unused_understood)
[if test $cmod_cv_c_attribute_unused_understood = yes ; then]
AC_DEFINE([HAVE_ATTRIBUTE_UNUSED], 1,
AC_DEFUN([CMOD_C_WORKING_ATTRIBUTE_UNUSED],
[AC_CACHE_CHECK([[whether $CC understands __attribute__((unused))]],
[[cmod_cv_c_working_attribute_unused]],
[dnl gcc 2.6.3 understands the __attribute__((unused)) syntax
dnl enough that it prints a warning and ignores it when the
dnl variable "i" is declared inside the function body, but it
dnl barfs on the construct when it is used in a
dnl parameter-declaration. That is why we have a function
dnl definition in the prologue of AC_LANG_PROGRAM part.
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[int cmod_x(int y __attribute__((unused)))
{ return 7; }]],
[[int i __attribute__((unused));]])],
[cmod_cv_c_working_attribute_unused=yes],
[cmod_cv_c_working_attribute_unused=no])])
[if test $cmod_cv_c_working_attribute_unused = yes ; then]
AC_DEFINE([HAVE_ATTRIBUTE_UNUSED], [1],
[Define if your compiler supports __attribute__ ((unused)).])
[fi]])dnl
......@@ -37,15 +37,22 @@ fi])dnl
dnl
dnl Another frozen defun.
dnl
AC_DEFUN(CMOD_C_ATTRIBUTE_UNUSED,
[AC_MSG_CHECKING([whether $CC understands __attribute__((unused))])
AC_CACHE_VAL([cmod_cv_c_attribute_unused_understood],
AC_TRY_COMPILE([int foo(int *i __attribute__((unused))) { *i = 4711; }],
[int i __attribute__((unused));],
[cmod_cv_c_attribute_unused_understood=yes],
[cmod_cv_c_attribute_unused_understood=no]))
AC_MSG_RESULT($cmod_cv_c_attribute_unused_understood)
[if test $cmod_cv_c_attribute_unused_understood = yes ; then]
AC_DEFINE([HAVE_ATTRIBUTE_UNUSED], 1,
AC_DEFUN([CMOD_C_WORKING_ATTRIBUTE_UNUSED],
[AC_CACHE_CHECK([[whether $CC understands __attribute__((unused))]],
[[cmod_cv_c_working_attribute_unused]],
[dnl gcc 2.6.3 understands the __attribute__((unused)) syntax
dnl enough that it prints a warning and ignores it when the
dnl variable "i" is declared inside the function body, but it
dnl barfs on the construct when it is used in a
dnl parameter-declaration. That is why we have a function
dnl definition in the prologue of AC_LANG_PROGRAM part.
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[int cmod_x(int y __attribute__((unused)))
{ return 7; }]],
[[int i __attribute__((unused));]])],
[cmod_cv_c_working_attribute_unused=yes],
[cmod_cv_c_working_attribute_unused=no])])
[if test $cmod_cv_c_working_attribute_unused = yes ; then]
AC_DEFINE([HAVE_ATTRIBUTE_UNUSED], [1],
[Define if your compiler supports __attribute__ ((unused)).])
[fi]])dnl
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment