linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Steve Graegert" <graegerts@gmail.com>
To: linux-c-programming@vger.kernel.org
Subject: Re: Function pointers to inline functions
Date: Wed, 4 Apr 2007 20:33:51 +0200	[thread overview]
Message-ID: <6a00c8d50704041133u30d98daavec529753606fc7e9@mail.gmail.com> (raw)
In-Reply-To: <4613DBC2.8060708@gmail.com>

Shriramana,

On 4/4/07, Shriramana Sharma <samjnaa@gmail.com> wrote:
> Hello.
>
> As per my understanding, an inline function is replaced in place by the
> compiler with the body of the function, so it does not have a separate
> location in memory in contrast with a regular function. This being so,
> how is it possible to extract a pointer to an inline function and
> effectively use it?
>
> See the attached two examples. They work and though it's a good thing
> for my project that I can extract a pointer to an inline function I do
> not understand how it is possible.

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.  So, effectively, the function
pointer does not point to an inline function at all.

       \Steve

--

Steve Grägert <steve@graegert.com>
Jabber    xmpp://graegerts@jabber.org
Internet  http://eth0.graegert.com, http://blog.graegert.com
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2007-04-04 18:33 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 [this message]
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

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=6a00c8d50704041133u30d98daavec529753606fc7e9@mail.gmail.com \
    --to=graegerts@gmail.com \
    --cc=linux-c-programming@vger.kernel.org \
    /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).