You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Christoffer Dam Bruun <cb...@systematic.dk> on 2001/08/21 15:03:05 UTC

compilation with inlined desctuctor fails on AIX 4.2, xlC 3 rev.1

Hi,

We are trying to compile Xerces 1.5.1 src on AIX and have run into some
compilation problems
makefiels generated with: 
runConfigure -paix -cxlc -xxlC -rnone

It appears that xlC will not accept that the following construct:

class A {
    A *left, *right;
    A() {left=0, left=0;};
    void amethod();
   ~A();
};

inline void  A::amethod()
{
    if (right)
      delete right;  // This calls the A destruct'er that is later declared
inline
}

inline A::~A()
{
  if (left)
    delete left;
  if (right)
    delete right;
}

If one tries to compile:

[/home/kfat] xlC -c a.cpp
"a.cpp", line 14.11: 1540-241: (S) "A::~A()" was declared with external
linkage
and called or defined before being declared as inline.
"a.cpp", line 14.1: 1540-377: (I) "A::~A()" is declared on line 5 of
"a.cpp".  

Even if we try to compile with "-qnoinline" it still fails with the same
error msg.

We have found 2 solutions:
1) move A::~A() up before A::amethod()
2) not declare A::~A()  inline

Know, what has this to do with Xerces :-)

We have encountered the above problem in the following files:
ContentSpecNode.hpp 
StringDatatypeValidator.hpp
DecimalDatatypeValidator.hpp
HexBinaryDatatypeValidator.hpp
Base64BinaryDatatypeValidator.hpp
NOTATIONDatatypeValidator.hpp
QNameDatatypeValidator.hpp
ListDatatypeValidator.hpp
UnionDatatypeValidator.hpp

Are we the only ones having problems compiling on AIX ?

Regards
Christoffer Bruun
email: cb@systematic.dk
tlf: 89432000

---
Ed is the standard text editor.
If you use ed, you are on the path to redemption, the
so-calleds "visual" editors have been placed here by ed to tempt the 
faithless.  DO NOT GIVE IN!!!  THE MIGHTY ED HAS SPOKEN!!!


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org