On Saturday 16 January 2010 00:34:19 brian m. carlson wrote: > On Fri, Jan 15, 2010 at 04:21:32PM -0600, Larry Kollar wrote: > > Environment: MacOSX 10.4.11 (Intel), gcc 4.0.1 > > > > I'm not a c++ expert in the least, but I couldn't get the CVS > > (from an hour ago) to compile without getting rid of the > > "inline" keyword from node::~node() as follows. Is this a > > problem on my end? > > This has been reported several times. For some reason, Mac OS X > has a problem compiling this. It works fine for me with Debian's > GCC 4.4.2-9. I'm not sure if this is a problem with GCC 4.0.1, or > simply with Apple's version of it, but if it's the former, it's > never going to be fixed. GCC 4.0.1 is pretty old.
Last time it was reported, I also reported it as a problem affecting Ubuntu-8.04-LTS (with gcc-4.2.4 IIRC). I'm no C++ expert either, but it does seem kind of strange to declare a method as `inline' when the implementation is not made available to every translation unit which refers to it, (which is the case here). In my (limited) experience, the complete implementation of inline methods is normally provided in the header which furnishes the class declaration, (which is not the case here). Declaring the node destructor as `inline', and then keeping its implementation private just seems wrong to me; we are essentially relying on the compiler to ignore the `inline' keyword, at the point where the implementation is provided, and to go ahead and create an extern implementation anyway; it seems that not all compilers, and not even all versions of GCC, will do that. -- Regards, Keith.