Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mm2/Little-CMS.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'm4/ax_gcc_func_attribute.m4')
-rw-r--r--m4/ax_gcc_func_attribute.m433
1 files changed, 27 insertions, 6 deletions
diff --git a/m4/ax_gcc_func_attribute.m4 b/m4/ax_gcc_func_attribute.m4
index 1edceba..fa4e089 100644
--- a/m4/ax_gcc_func_attribute.m4
+++ b/m4/ax_gcc_func_attribute.m4
@@ -1,5 +1,5 @@
# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_gcc_func_attribute.html
+# https://www.gnu.org/software/autoconf-archive/ax_gcc_func_attribute.html
# ===========================================================================
#
# SYNOPSIS
@@ -38,9 +38,11 @@
# dllimport
# error
# externally_visible
+# fallthrough
# flatten
# format
# format_arg
+# gnu_format
# gnu_inline
# hot
# ifunc
@@ -53,6 +55,8 @@
# nothrow
# optimize
# pure
+# sentinel
+# sentinel_position
# unused
# used
# visibility
@@ -61,9 +65,9 @@
# weak
# weakref
#
-# Unsuppored function attributes will be tested with a prototype returning
-# an int and not accepting any arguments and the result of the check might
-# be wrong or meaningless so use with care.
+# Unsupported function attributes will be tested with a prototype
+# returning an int and not accepting any arguments and the result of the
+# check might be wrong or meaningless so use with care.
#
# LICENSE
#
@@ -74,7 +78,7 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.
-#serial 3
+#serial 13
AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [
AS_VAR_PUSHDEF([ac_var], [ax_cv_have_func_attribute_$1])
@@ -128,12 +132,18 @@ AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [
[externally_visible], [
int foo( void ) __attribute__(($1));
],
+ [fallthrough], [
+ void foo( int x ) {switch (x) { case 1: __attribute__(($1)); case 2: break ; }};
+ ],
[flatten], [
int foo( void ) __attribute__(($1));
],
[format], [
int foo(const char *p, ...) __attribute__(($1(printf, 1, 2)));
],
+ [gnu_format], [
+ int foo(const char *p, ...) __attribute__((format(gnu_printf, 1, 2)));
+ ],
[format_arg], [
char *foo(const char *p) __attribute__(($1(1)));
],
@@ -175,6 +185,15 @@ AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [
[pure], [
int foo( void ) __attribute__(($1));
],
+ [sentinel], [
+ int foo(void *p, ...) __attribute__(($1));
+ ],
+ [sentinel_position], [
+ int foo(void *p, ...) __attribute__(($1(1)));
+ ],
+ [returns_nonnull], [
+ void *foo( void ) __attribute__(($1));
+ ],
[unused], [
int foo( void ) __attribute__(($1));
],
@@ -184,6 +203,8 @@ AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [
[visibility], [
int foo_def( void ) __attribute__(($1("default")));
int foo_hid( void ) __attribute__(($1("hidden")));
+ int foo_int( void ) __attribute__(($1("internal")));
+ int foo_pro( void ) __attribute__(($1("protected")));
],
[warning], [
int foo( void ) __attribute__(($1("")));
@@ -207,7 +228,7 @@ AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [
dnl GCC doesn't exit with an error if an unknown attribute is
dnl provided but only outputs a warning, so accept the attribute
dnl only if no warning were issued.
- [AS_IF([test -s conftest.err],
+ [AS_IF([grep -- -Wattributes conftest.err],
[AS_VAR_SET([ac_var], [no])],
[AS_VAR_SET([ac_var], [yes])])],
[AS_VAR_SET([ac_var], [no])])