Fix recently added M4 macro files

These macros copied in from the Autoconf Macro Archive were missing
support for the following attributes:
 - AX_GCC_VAR_ATTRIBUTE() for __attribute__(section("..."))
 - AX_GCC_FUNC_ATTRIBUTE() for __attribute__(returns_nonnull)

This commit fixes them.  (The versions in aclocal.m4 were already fixed,
but aclocal.m4 is about to be removed from version control.)
This commit is contained in:
Andrew Bettison 2016-01-11 16:29:22 +10:30
parent 10ac5733a1
commit f6c2706796
2 changed files with 12 additions and 4 deletions

View File

@ -53,6 +53,7 @@
# nothrow
# optimize
# pure
# returns_nonnull (added 23 Nov 2015, Serval Project)
# unused
# used
# visibility
@ -61,7 +62,7 @@
# weak
# weakref
#
# Unsuppored function attributes will be tested with a prototype returning
# 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.
#
@ -175,6 +176,9 @@ AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [
[pure], [
int foo( void ) __attribute__(($1));
],
[returns_nonnull], [
char * foo( void ) __attribute__(($1));
],
[unused], [
int foo( void ) __attribute__(($1));
],
@ -201,7 +205,7 @@ AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [
static int bar( void ) __attribute__(($1("foo")));
],
[
m4_warn([syntax], [Unsupported attribute $1, the test may fail])
m4_warn([syntax], [Unsupported attribute "$1", the test may fail])
int foo( void ) __attribute__(($1));
]
)], [])

View File

@ -30,6 +30,7 @@
# deprecated
# mode
# packed
# section (added 23 Nov 2015, Serval Project)
# tls_model
# unused
# used
@ -39,7 +40,7 @@
# dllexport
# init_priority
#
# Unsuppored variable attributes will be tested against a global integer
# Unsupported variable attributes will be tested against a global integer
# variable and without any arguments given to the attribute itself; the
# result of this check might be wrong or meaningless so use with care.
#
@ -83,6 +84,9 @@ AC_DEFUN([AX_GCC_VAR_ATTRIBUTE], [
int baz __attribute__(($1));
};
],
[section], [
int foo __attribute__(($1("a"))) = 0;
],
[tls_model], [
__thread int bar1 __attribute__(($1("global-dynamic")));
__thread int bar2 __attribute__(($1("local-dynamic")));
@ -112,7 +116,7 @@ AC_DEFUN([AX_GCC_VAR_ATTRIBUTE], [
bar b __attribute__(($1(65535/2)));
],
[
m4_warn([syntax], [Unsupported attribute $1, the test may fail])
m4_warn([syntax], [Unsupported attribute "$1", the test may fail])
int foo __attribute__(($1));
]
)], [