All of lore.kernel.org
 help / color / mirror / Atom feed
From: Glynn Clements <glynn@gclements.plus.com>
To: Shriramana Sharma <samjnaa@gmail.com>
Cc: linux-c-programming@vger.kernel.org
Subject: Re: Function pointers to inline functions
Date: Mon, 4 Jun 2007 08:08:58 +0100	[thread overview]
Message-ID: <18019.47754.381600.13402@cerise.gclements.plus.com> (raw)
In-Reply-To: <465C249A.4000007@gmail.com>


Shriramana Sharma wrote:

> >> I mean, if I use -fkeep-inline-functions to get the function output in 
> >> the object file, and if the static keyword also meant that the function 
> >> is visible only in the translation unit in which it appears, then 
> >> -fkeep-inline-functions would be rendered useless, 
> 
> ... in the case of static inline functions.

Non-static inline functions are always generated so that they can be
called from other translation units. It's only when a function is both
static and inline that you can (normally) eliminate the function body
altogether.

> Is this correct or no?
> 
> Would a function visible only in its translation unit be accessible from 
> a debugger, as you say?

Yes.

The debugger might still require the function to be in scope (i.e. the
active stack frame must be in the same translation unit) in order to
call it, but that's down to how the debugger resolves symbols which
are entered by the user.

gdb doesn't have this requirement.

> I would test it myself, but I haven't any idea 
> how to load just a single object file in gdb and test it so I am asking.

Add a minimal main.c so that you can run it as a program.

-- 
Glynn Clements <glynn@gclements.plus.com>

  reply	other threads:[~2007-06-04  7:08 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 [this message]
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

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=18019.47754.381600.13402@cerise.gclements.plus.com \
    --to=glynn@gclements.plus.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.