diff options
author | Alexandre Oliva <aoliva@redhat.com> | 2001-10-18 18:29:02 +0000 |
---|---|---|
committer | Alexandre Oliva <aoliva@gcc.gnu.org> | 2001-10-18 18:29:02 +0000 |
commit | 9162542e3d0cd270ab972615f66d7da16662466d (patch) | |
tree | ba59c40e9652d1cafe3687880cd7a3e173e06791 /gcc/doc/extend.texi | |
parent | 97055d5c4e5ce6792523800bbd326313f81a48ef (diff) | |
download | gcc-9162542e3d0cd270ab972615f66d7da16662466d.tar.gz |
attribs.c (handle_noinline_attribute): New function.
* attribs.c (handle_noinline_attribute): New function.
(handle_used_attribute): Likewise.
(c_common_attribute_table): Added noinline and used.
* doc/extend.texi (Function Attributes): Document them.
* c-decl.c (duplicate_decls): Propagate DECL_UNINLINABLE.
Warn when merging inline with attribute noinline.
(start_decl, start_function): Warn if inline and attribute
noinline appear in the same declaration.
From-SVN: r46334
Diffstat (limited to 'gcc/doc/extend.texi')
-rw-r--r-- | gcc/doc/extend.texi | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 132ccbad14f..f94950b2102 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -1925,13 +1925,14 @@ carefully. The keyword @code{__attribute__} allows you to specify special attributes when making a declaration. This keyword is followed by an -attribute specification inside double parentheses. Fourteen attributes, -@code{noreturn}, @code{pure}, @code{const}, @code{format}, -@code{format_arg}, @code{no_instrument_function}, @code{section}, -@code{constructor}, @code{destructor}, @code{unused}, @code{weak}, -@code{malloc}, @code{alias} and @code{no_check_memory_usage} are -currently defined for functions. Several other attributes are defined -for functions on particular target systems. Other attributes, including +attribute specification inside double parentheses. The following +attributs are currently defined for functions on all targets: +@code{noreturn}, @code{noinline}, @code{pure}, @code{const}, +@code{format}, @code{format_arg}, @code{no_instrument_function}, +@code{section}, @code{constructor}, @code{destructor}, @code{used}, +@code{unused}, @code{weak}, @code{malloc}, @code{alias} and +@code{no_check_memory_usage}. Several other attributes are defined for +functions on particular target systems. Other attributes, including @code{section} are supported for variables declarations (@pxref{Variable Attributes}) and for types (@pxref{Type Attributes}). @@ -1987,6 +1988,11 @@ typedef void voidfn (); volatile voidfn fatal; @end smallexample +@cindex @code{noinline} function attribute +@item noinline +This function attribute prevents a function from being considered for +inlining. + @cindex @code{pure} function attribute @item pure Many functions have no effects except the return value and their @@ -2174,12 +2180,20 @@ the program. These attributes are not currently implemented for Objective-C@. +@cindex @code{unused} attribute. @item unused This attribute, attached to a function, means that the function is meant to be possibly unused. GCC will not produce a warning for this function. GNU C++ does not currently support this attribute as definitions without parameters are valid in C++. +@cindex @code{used} attribute. +@item used +This attribute, attached to a function, means that code must be emitted +for the function even if it appears that the function is not referenced. +This is useful, for example, when the function is referenced only in +inline assembly. + @item weak @cindex @code{weak} attribute The @code{weak} attribute causes the declaration to be emitted as a weak |