Blob Blame History Raw
@node ax_gcc_var_attribute
@unnumberedsec ax_gcc_var_attribute

@majorheading Synopsis

@smallexample
AX_GCC_VAR_ATTRIBUTE(ATTRIBUTE)
@end smallexample

@majorheading Description

This macro checks if the compiler supports one of GCC's variable
attributes; many other compilers also provide variable attributes with
the same syntax. Compiler warnings are used to detect supported
attributes as unsupported ones are ignored by default so quieting
warnings when using this macro will yield false positives.

The ATTRIBUTE parameter holds the name of the attribute to be checked.

If ATTRIBUTE is supported define HAVE_VAR_ATTRIBUTE_<ATTRIBUTE>.

The macro caches its result in the ax_cv_have_var_attribute_<attribute>
variable.

The macro currently supports the following variable attributes:

@smallexample
 aligned
 cleanup
 common
 nocommon
 deprecated
 mode
 packed
 tls_model
 unused
 used
 vector_size
 weak
 dllimport
 dllexport
 init_priority
@end smallexample

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.

@majorheading Source Code

Download the
@uref{http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_gcc_var_attribute.m4,latest
version of @file{ax_gcc_var_attribute.m4}} or browse
@uref{http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=history;f=m4/ax_gcc_var_attribute.m4,the
macro's revision history}.

@majorheading License

@w{Copyright @copyright{} 2013 Gabriele Svelto @email{gabriele.svelto@@gmail.com}}

Copying and distribution of this file, with or without modification, are
permitted in any medium without royalty provided the copyright notice
and this notice are preserved.  This file is offered as-is, without any
warranty.