diff options
author | Jakub Jelinek <jakub@redhat.com> | 2006-11-08 00:01:23 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2006-11-08 00:01:23 +0100 |
commit | 4eb7fd8398359a44e2483b61c539508497fe9fcd (patch) | |
tree | ef34d7e6f5808177003e88ab3eb698579a33ddb9 /gcc/doc | |
parent | a7f02c2d27203d8e3581bfdc19f86f863ebf0d80 (diff) | |
download | gcc-4eb7fd8398359a44e2483b61c539508497fe9fcd.zip gcc-4eb7fd8398359a44e2483b61c539508497fe9fcd.tar.gz gcc-4eb7fd8398359a44e2483b61c539508497fe9fcd.tar.bz2 |
c-common.c (c_common_attributes): Add gnu_inline attribyte.
* c-common.c (c_common_attributes): Add gnu_inline attribyte.
(handle_gnu_inline_attribute): New function.
* c-decl.c (diagnose_mismatched_decls): Handle gnu_inline attribute.
(merge_decls, start_decl, start_function): Likewise.
* doc/extend.texi: Document gnu_inline attribute.
* gcc.dg/inline-17.c: New test.
From-SVN: r118567
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/extend.texi | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 9ec4460..1579b94 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -1581,8 +1581,8 @@ attributes are currently defined for functions on all targets: @code{format}, @code{format_arg}, @code{no_instrument_function}, @code{section}, @code{constructor}, @code{destructor}, @code{used}, @code{unused}, @code{deprecated}, @code{weak}, @code{malloc}, -@code{alias}, @code{warn_unused_result}, @code{nonnull} -and @code{externally_visible}. Several other +@code{alias}, @code{warn_unused_result}, @code{nonnull}, +@code{gnu_inline} and @code{externally_visible}. 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}). @@ -1620,6 +1620,11 @@ Generally, functions are not inlined unless optimization is specified. For functions declared inline, this attribute inlines the function even if no optimization level was specified. +@item gnu_inline +@cindex @code{gnu_inline} function attribute +This attribute on an inline declaration results in the old GNU C89 +inline behavior even in the ISO C99 mode. + @cindex @code{flatten} function attribute @item flatten Generally, inlining into a function is limited. For a function marked with @@ -3802,7 +3807,8 @@ also direct GCC to try to integrate all ``simple enough'' functions into their callers with the option @option{-finline-functions}. GCC implements three different semantics of declaring a function -inline. One is available with @option{-std=gnu89}, another when +inline. One is available with @option{-std=gnu89} or when @code{gnu_inline} +attribute is present on all inline declarations, another when @option{-std=c99} or @option{-std=gnu99}, and the third is used when compiling C++. |