This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Guidance please: static or extern __inline__
- From: Daniel Jacobowitz <drow at false dot org>
- To: Kean Johnston <jkj at sco dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 28 Jul 2005 13:54:05 -0400
- Subject: Re: Guidance please: static or extern __inline__
- References: <42E903E5.4040905@sco.com>
On Thu, Jul 28, 2005 at 09:12:21AM -0700, Kean Johnston wrote:
> to:
> extern int stat (const char *__p, stat_t *__s);
> extern __inline__ int
> stat(const char *__p, stat_t *__s)
> {
> return _xstat(_STAT_VER, __p, __s);
> }
...
> From reading teh docs it seems like 'extern __inline__' was
> the way to go for this type of header file trickery. However,
> it caused a problem bootstrapping the compiler, becuase the
> first stage doesn't have -O, so any calls to stat() actually
> go to the library routine called stat(), which is an old,
> deprecated stat that can't deal with, say, 32-bit inodes or
> uid_t's etc, and various programs like fixincludes then
> fail to stat files.
...
> However, I *think* I like the semantics of 'extern inline'
> better: use the inline version for the most part but if,
> for example, you take the address of the function, use the
> actual symbol stat(). But I see that most other fixincs
> use static inline.
Huh? This paragraph conflicts with the previous one I quoted. You
don't want extern inline, because you don't want the symbol stat() to
be called - that's your whole problem.
--
Daniel Jacobowitz
CodeSourcery, LLC