1 # Test for GCC-style __attribute__ support.
3 dnl Copyright (C) 2011 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
10 # Currently only __attribute__ ((__noreturn__)) is done,
11 # but other macros can be added to this file as needed.
13 # Test whether __attribute__ ((__noreturn__)) works.
14 AC_DEFUN([gl_ATTRIBUTE_NORETURN], [
15 AC_CACHE_CHECK([for __attribute__ ((__noreturn__))],
16 [gl_cv_attribute_noreturn],
17 [gl_save_werror_flag=$ac_[]_AC_LANG_ABBREV[]_werror_flag
18 ac_[]_AC_LANG_ABBREV[]_werror_flag=yes
21 [[void never_come_back (int) __attribute__ ((__noreturn__));]])],
22 [gl_cv_attribute_noreturn=yes],
23 [gl_cv_attribute_noreturn=no])
24 ac_[]_AC_LANG_ABBREV[]_werror_flag=$gl_save_werror_flag])
25 if test $gl_cv_attribute_noreturn = no; then
26 HAVE_ATTRIBUTE_NORETURN=0
28 AC_SUBST([HAVE_ATTRIBUTE_NORETURN])