This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -O1 -Winline
Mathieu Lacage <Mathieu.Lacage@sophia.inria.fr> writes:
| On Thu, 2004-09-16 at 02:06, James E Wilson wrote:
| > For C code, where inline
| > tends to be used sparingly, and only for functions that are likely to be
| > inlined, this warning may give you useful info. For C++ code, where
| > inline tends to be used a lot, and some things are implicitly inline,
| > this warning will just give you a lot of noise.
|
| It would be great to add this to the gcc manual. Although what you say
| is obvious, I never thought about it before and, obviously, this poster
| did not either.
Well, people opinions vary on "inline" in C++ code. Most certainly
when I say inline, I'm expecting the compiler to honor it in most
cases. I don't buy the notion of implicit inline. It is just plain
excuse and invention. Inline functions in C++ started as being those
whose definitions appeared in-class definition. It is only later that
the keyword appeared. But, I guess that is just repeating a debate
that already took place.
Some compilers have taken the history rewritting to the point where
they have completely transmuted the meaning of "inline", and propose
non-standard vendor lock-in "__inline" if one really means inline.
That is silly. It would be rather disappointing if GCC had to take
that route.
-- Gaby