linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Glynn Clements <glynn@gclements.plus.com>
To: Shriramana Sharma <samjnaa@gmail.com>
Cc: Steve Graegert <graegerts@gmail.com>,
	linux-c-programming@vger.kernel.org
Subject: Re: Function pointers to inline functions
Date: Fri, 25 May 2007 23:45:02 +0100	[thread overview]
Message-ID: <18007.26350.946287.490717@cerise.gclements.plus.com> (raw)
In-Reply-To: <465668F6.6060206@gmail.com>


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@gclements.plus.com>

      reply	other threads:[~2007-05-25 22:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-04 17:09 Function pointers to inline functions Shriramana Sharma
2007-04-04 18:23 ` Glynn Clements
2007-05-25  4:57   ` Shriramana Sharma
2007-05-25 22:41     ` Glynn Clements
2007-05-29 13:03       ` Shriramana Sharma
2007-06-04  7:08         ` Glynn Clements
2007-05-25  6:02   ` Shriramana Sharma
2007-04-04 18:33 ` Steve Graegert
2007-04-27 17:01   ` Shriramana Sharma
2007-05-04 13:40     ` Glynn Clements
2007-05-25  4:41   ` Shriramana Sharma
2007-05-25 22:45     ` Glynn Clements [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=18007.26350.946287.490717@cerise.gclements.plus.com \
    --to=glynn@gclements.plus.com \
    --cc=graegerts@gmail.com \
    --cc=linux-c-programming@vger.kernel.org \
    --cc=samjnaa@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).