From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26163 invoked by alias); 22 Oct 2005 19:11:37 -0000 Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Received: (qmail 26115 invoked by uid 22791); 22 Oct 2005 19:11:32 -0000 Received: from londo.lunn.ch (HELO londo.lunn.ch) (80.238.139.98) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Sat, 22 Oct 2005 19:11:32 +0000 Received: from lunn by londo.lunn.ch with local (Exim 3.36 #1 (Debian)) id 1ETOm6-0002Dx-00; Sat, 22 Oct 2005 21:11:26 +0200 Date: Sat, 22 Oct 2005 19:11:00 -0000 To: Alexander Neundorf Cc: ecos-discuss@ecos.sourceware.org Message-ID: <20051022191126.GU7087@lunn.ch> Mail-Followup-To: Alexander Neundorf , ecos-discuss@ecos.sourceware.org References: <20051021201131.GS7087@lunn.ch> <43595DC0.9050505@dadadada.net> <20051022075052.GT7087@lunn.ch> <200510221524.56907.neundorf@kde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200510221524.56907.neundorf@kde.org> User-Agent: Mutt/1.5.11 From: Andrew Lunn Subject: Re: [ECOS] help with C++ needed.... X-SW-Source: 2005-10/txt/msg00184.txt.bz2 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 // thread definitions #include // flag definitions #include // clock definitions #include #include 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