Re: Function pointers to inline functions

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

 



Shriramana Sharma wrote:

> > Whenever you request a pointer to an inline function the compiler will
> > place a normal subroutine version of the inline's implementation in an
> > object file and return its address.
> 
> Does this mean that the compiler will check the entire translation unit 
> where the inline function is visible for pointer-request operations on 
> the function and if any are present, the compiler will place a normal 
> version in the object file?

Yes. A pointer to a function requires that the function actually
exists somewhere in the process' address space. Inline functions don't
"exist" in that sense.

> This would mean that the function is output separately even if 
> -finline-functions is used. Is that true?

Yes.

> Do I have a way of checking whether a function is output separately or 
> not using nm? Do I just check to see whether the function name is there 
> in the output or do I have to look for some flag on the function name? I 
> am still not aware of the full depth of using nm.

If the name appears in the output from "nm", then the function exists.
If it's inlined, it won't appear in the output from "nm".

-- 
Glynn Clements <glynn@xxxxxxxxxxxxxxxxxx>
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Assembler]     [Git]     [Kernel List]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [C Programming]     [Yosemite Campsites]     [Yosemite News]     [GCC Help]

  Powered by Linux