Re: inline functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Kövesdi György wrote:
> I found that the function other_class::f2() cannot be inlined

I filled the blanks in your example with simple code and f1 as
well as f2 were inlined into the called of f2 when using -O1.  You
should provide a complete compilable example of a situation that
doesn't do what you want.

> Trying to add __attribute__((inline)) the result is a warning
> message about ignoring this attribute.

I guess it's because if you define a method directly in the class
body, you implicitely tell the compiler to inline it, thus making
this attribute redundant.  See [1].  (It still only happens with
optimization turned on.)

[1] http://www.parashift.com/c++-faq-lite/inline-functions.html#faq-9.8

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux