public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Alexander Neundorf <neundorf@kde.org>
Cc: ecos-discuss@ecos.sourceware.org
Subject: Re: [ECOS] help with C++ needed....
Date: Sat, 22 Oct 2005 19:11:00 -0000	[thread overview]
Message-ID: <20051022191126.GU7087@lunn.ch> (raw)
In-Reply-To: <200510221524.56907.neundorf@kde.org>

On Sat, Oct 22, 2005 at 03:24:55PM +0200, Alexander Neundorf wrote:
> On Saturday 22 October 2005 09:50, Andrew Lunn wrote:
> > On Fri, Oct 21, 2005 at 05:29:36PM -0400, Billy wrote:
> ...
> > > The usage:   "inline foo();" (with a semicolon) smells fishy.
> > >
> > > Maybe you tried that already.
> >
> > Yep, tried that, same error.
> 
> Maybe it helps to have a look at the preprocessed file ?

Yes, it did. I think i now understand it.

thread.hxx declares the class Cyg_ThreadQueue which has a member
function empty.

thread.inl contains the implementation of Cyg_ThreadQueue::empty() and
says it is an inline function.

flag.hxx declares the class Cyg_Flag. It has a member variable queue
of type Cyg_ThreadQueue. It also declares a member function waiting()
which is inline and the implementation is given there and then. This
implementation is !queue.empty().

It is select.cxx which is giving the problem. At the beginning this does:

#include <cyg/kernel/thread.hxx>       // thread definitions
#include <cyg/kernel/flag.hxx>         // flag definitions
#include <cyg/kernel/clock.hxx>        // clock definitions

#include <cyg/kernel/sched.inl>
#include <cyg/kernel/thread.inl>

So the problem is that in flag.hxx the compiler has seen there is a
member function queue(), but it has not seems the implementation
yet. So it generates a function call and adds queue to its symbol
table as an out of line function. It later gets to see the
implementation of queue and finds its supposed to be an inline
function, but it has already generated code which assumes its an out
of line function, and so it generates the warning and generates code
for the out of line implementation of queue.

So its looks like flag.hxx needs to include both thread.hxx and
thread.inl.

Thats my theory anyway. I just need to test it.

It might also be worth posting a gcc bug asking for them to make the
error message a bit easier to understand.

        Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

  reply	other threads:[~2005-10-22 19:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-21 20:11 Andrew Lunn
2005-10-21 21:29 ` Billy
2005-10-21 21:35   ` Billy
2005-10-22  7:51   ` Andrew Lunn
2005-10-22 13:25     ` Alexander Neundorf
2005-10-22 19:11       ` Andrew Lunn [this message]
2005-10-23  6:48         ` Paul D. DeRocco

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=20051022191126.GU7087@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=ecos-discuss@ecos.sourceware.org \
    --cc=neundorf@kde.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 read-only IMAP folder(s) and NNTP newsgroup(s).