This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch, 4.2, docs] Edit -fgnu89-inline, gnu_inline attribute documentation.


I had a couple of comments on the documentation Ian Taylor's recent c99-inline patch, but he'd already committed it by the time that I posted them, so I'm submitting them as the following patch.

Mostly, my comments were that "effectively ignored" implies, to me, that the compiler is doing the opposite of what the attribute or option would say to do, and this seemed confusing to me when the actual meaning in this case is that the compiler does what the attribute or option says to do regardless of whether or not it's present. This patch rewrites the parts that I found confusing.

Also, the cross-reference to the pre-processor macros is buggy; writing the referenced filename as "cpp.info" rather than just "cpp" means that in a PDF file the cross-reference is to the nonexistent cpp.info.pdf. (On the other hand, Makeinfo is smart enough not to reference cpp.info.info, so it works either way there.)

------------------------------------------------------------------
2007-03-12  Brooks Moses  <brooks.moses@codesourcery.com>

	* doc/extend.texi: Edit "gnu_inline" documentation.
	* doc/invoke.texi: Edit "-fgnu89-inline" documentation.

------------------------------------------------------------------

Tested with "make info" and "make pdf" on i686-pc-linux-gnu. Ok for 4.2?

- Brooks
Index: gcc/doc/extend.texi
===================================================================
--- gcc/doc/extend.texi	(revision 122864)
+++ gcc/doc/extend.texi	(working copy)
@@ -1654,10 +1654,11 @@
 @code{__GNUC_STDC_INLINE__} are defined.  @xref{Inline,,An Inline
 Function is As Fast As a Macro}.
 
-Note that since the first version of GCC to support C99 inline
-semantics is 4.3, earlier versions of GCC which accept this attribute
-effectively ignore it.  Its only effect is to disable warnings about
-using inline functions in C99 mode.
+Note that since the first version of GCC to support C99 inline semantics
+is 4.3, earlier versions of GCC which accept this attribute effectively
+assume that it is always present, whether or not it is given explicitly.
+In versions prior to 4.3, the only effect of explicitly including it is
+to disable warnings about using inline functions in C99 mode.
 
 @cindex @code{flatten} function attribute
 @item flatten
Index: gcc/doc/invoke.texi
===================================================================
--- gcc/doc/invoke.texi	(revision 122864)
+++ gcc/doc/invoke.texi	(working copy)
@@ -1218,21 +1218,23 @@
 @opindex fgnu89-inline
 The option @option{-fgnu89-inline} tells GCC to use the traditional
 GNU semantics for @code{inline} functions when in C99 mode.
-@xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
-is accepted and ignored by GCC versions 4.1.3 up to but not including
-4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
-C99 mode.  Using this option is roughly equivalent to adding the
-@code{gnu_inline} function attribute to all inline functions
-(@pxref{Function Attributes}).
+@xref{Inline,,An Inline Function is As Fast As a Macro}.  Using this
+option is roughly equivalent to adding the @code{gnu_inline} function
+attribute to all inline functions (@pxref{Function Attributes}).
 
-The option @option{-fno-gnu89-inline} is not supported in versions of
-GCC before 4.3.  It will be supported only in C99 or gnu99 mode, not
-in C89 or gnu89 mode.
+This option is accepted by GCC versions 4.1.3 and up.  In GCC versions
+prior to 4.3, C99 inline semantics are not supported, and thus this
+option is effectively assumed to be present regardless of whether or not
+it is specified; the only effect of specifying it explicitly is to
+disable warnings about using inline functions in C99 mode.  Likewise,
+the option @option{-fno-gnu89-inline} is not supported in versions of
+GCC before 4.3.  It will be supported only in C99 or gnu99 mode, not in
+C89 or gnu89 mode.
 
 The preprocesor macros @code{__GNUC_GNU_INLINE__} and
 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
 in effect for @code{inline} functions.  @xref{Common Predefined
-Macros,,,cpp.info,The C Preprocessor}.
+Macros,,,cpp,The C Preprocessor}.
 
 @item -aux-info @var{filename}
 @opindex aux-info

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]