Inline documentation patch...

Lee Iverson
Mon Feb 8 17:11:00 GMT 1999


Since Linus is so hot under the collar, and the language does seem to
strongly suggest that inlining is guaranteed without outright
guaranteeing it, I'm suggesting that this hedge language be added to
the documentation.  Note that I don't agree that this is a change in
documented behavior, just a clarification of what is currently only

Lee Iverson     		SRI International			333 Ravenswood Ave., Menlo Park CA 94025	(650) 859-3307

1999-02-08  Lee Iverson  <leei@Canada.AI.SRI.COM>

	*  extend.texi (Inline): Add explicit language making it
	   perfectly clear that gcc doesn't guarantee that functions
	   declared inline are actually inlined.  Reference statement
	   expressions and -Winline as alternatives.

Index: gcc/extend.texi
RCS file: /egcs/carton/cvsfiles/egcs/gcc/extend.texi,v
retrieving revision 1.22
diff -p -u -r1.22 extend.texi
--- extend.texi	1999/01/04 11:56:18	1.22
+++ extend.texi	1999/02/09 00:54:29
@@ -2315,6 +2315,15 @@ clear whether it is better to inline or 
 that a correct implementation when not optimizing was difficult.  So we
 did the easy thing, and turned it off.
+@emph{N.B.}  GNU C cannot guarantee that all functions declared
+@code{inline} will actually be inlined, even those declared
+@code{extern}.  If it is you need to guarantee that the code actually
+be inserted at the point of use, then there is no other option than to
+use a macro and Statement Expressions (@pxref{Statement Exprs}).  If
+you merely wish to be notified when an inline attempt has failed, then
+you will be notified with the -Winline option (@pxref{Warning
 @node Extended Asm
 @section Assembler Instructions with C Expression Operands
 @cindex extended @code{asm}

More information about the Gcc-patches mailing list