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 Robert Buck <Ro...@mathworks.com> on 2004/04/02 17:18:05 UTC

Errors with Sun's latest compiler

Hi,

Forgive me in advance for my griping about Sun's (crappy) compilers and linkers. But I've spent three days dealing with their linker and compiler issues while working on getting ICU going. Now that is completed and behind me, on to Xerces-C. I have found some minor annoyances and bugs in Xerces-C, that I've dealt with appropriately. But this one, below, stumps me.

Error:

CC -KPIC -mt -xs -ptr/home/rbuck/tmp/THIRD_PARTY/sol2c5/xerces-c-src_2_5_0/obj/SOLARIS -features=rtti -DSOLARIS  -c -I/home/rbuck/tmp/THIRD_PARTY/sol2c5/xerces-c-src_2_5_0/include -dalign -library=Cstd,Crun -mt  -DICU_UNICODE_CLASS_USE_DEPRECATES -DICU_UCHAR_USE_DEPRECATES -w -O -DPROJ_XMLPARSER  -DPROJ_XMLUTIL  -DPROJ_PARSERS  -DPROJ_SAX4C  -DPROJ_SAX2  -DPROJ_DOM  -DPROJ_VALIDATORS -DXML_USE_ICU_TRANSCODER -I/home/rbuck/tmp/THIRD_PARTY/sol2c5/icu-package/release/include -DXML_USE_INMEM_MESSAGELOADER -DXML_USE_PTHREADS -DXML_USE_NETACCESSOR_SOCKET     -o /home/rbuck/tmp/THIRD_PARTY/sol2c5/xerces-c-src_2_5_0/obj/SOLARIS/DGXMLScanner.o DGXMLScanner.cpp
"/home/rbuck/tmp/THIRD_PARTY/sol2c5/xerces-c-src_2_5_0/include/xercesc/util/NameIdPool.c", line 281: Error: ThrowXMLwithMemMgr1 is not defined.
"/home/rbuck/tmp/THIRD_PARTY/sol2c5/xerces-c-src_2_5_0/include/xercesc/util/NameIdPool.c", line 285: Error: Pool_ElemAlreadyExists may not have a type qualifier.
"/home/rbuck/tmp/THIRD_PARTY/sol2c5/xerces-c-src_2_5_0/include/xercesc/util/NameIdPool.c", line 285: Error: "," expected instead of "->".
3 Error(s) detected.
gmake[1]: *** [DGXMLScanner.o] Error 3

Compiler version:

rbuck@bat70sol2 ~/tmp/THIRD_PARTY/sol2c5 [2,41] > CC -V
CC: Sun C++ 5.5 Patch 113817-06 2004/01/29

Offending Code:

        ThrowXMLwithMemMgr1
        (
            IllegalArgumentException
            , XMLExcepts::Pool_ElemAlreadyExists
            , elemToAdopt->getKey()
            , fMemoryManager
        );

Dispensing with the macro, and calling throw directly, works around the problem. The new code:

        throw IllegalArgumentException(__FILE__, __LINE__,
            XMLExcepts::Pool_ElemAlreadyExists, elemToAdopt->getKey(), 0, 0, 0, fMemoryManager);

We've already found three major bugs in their latest compiler. Here it appears that their c-preprocessor is wacked. I'd rather not have to custom patch Xerces-C to work with Sun's compilers. Perhaps there is another explanation, and I am willing to hear it. Any ideas or alternative solutions anyone?

Thanks in advance,

 --Bob