groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] Compile error


From: Keith Marshall
Subject: Re: [Groff] Compile error
Date: Wed, 23 Sep 2009 10:01:11 +0100
User-agent: KMail/1.9.10

On Tuesday 22 September 2009 20:18:39 Werner LEMBERG wrote:
> > g++ -g -O2  -o troff dictionary.o div.o env.o input.o
> > majorminor.o mtsm.o node.o number.o reg.o
> > /Users/rgouldin/Downloads/groff-current/src/libs/libgroff/libgro
> >ff.a -lm
> > Undefined symbols:
> >   "node::~node()", referenced from:
>
> This is a g++ compiler bug, AFAIK.

Maybe; maybe not, but I do see the same issue on my regularly updated 
Ubuntu-8.04 box, with gcc-4.2.4.

My expertise is in C, not C++; however, it appears to me that this:

  2009-04-10  Werner LEMBERG  <address@hidden>

        Fix a memory leak in troff for -Thtml.
        Reported by Urs Eggli <address@hidden>.

        * src/roff/troff/node.h (node::~node): Move to...
        * src/roff/troff/node.cpp: Here.  Free `state' and 
        `push_state'.

moved the implementation of node::~node out of the header file, so 
it is no longer visible outside of src/roff/troff/node.cpp, yet it is 
still declared as `inline' within the node class definition.  Surely, 
to be inlined, the body of the implementation must be fully visible 
at every point of use?  Certainly, the compiler does not seem to 
generate any publicly visible symbol for the implementation, where 
it is defined in node.cpp; hence references from other translation 
units remain unresolved.

To fix this, I would revert that 2009-04-10 change, then add the body 
for the implementation of the inline destructor directly into the 
class definition.  Alternatively, recognise that the destructor needs 
a non-inline implementation, and remove the `inline' attribute both 
from the declaration in the class definition, and from the 
implementation itself.

-- 

Regards,
Keith.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]