Hello all,

After further investigation on this issue i discovered the const qualifier
in the error message is a gcc generated constructor like method for the
__pthread_mutex struct.

This generated piece of code contains the const expression that collides with 
the volatile definition of the struct defined in the sys/types.h file of 
UnixWare.

This "constructor" is called within the initialization list of the
constructor of XMLHoler (see below).

Initializing the member fInstance() results in the call
`__pthread_mutex::__pthread_mutex(const __pthread_mutex &)' which causes
the error: conversion from `volatile pthread_mutex_t' to `const
__pthread_mutex &' discards qualifiers.

If i remove the call to fInstance() Xerces compiles the PlatformUtils
object. But I don't know whether Xerces will work properly without the
initialization of fInstance.

Dow you know whether any parts of the Xerces code do rely on the
initialization of fInstance?

XMLHolder.hpp

    24  template<class Type>
    25  class XMLUTIL_EXPORT XMLHolder : public XMemory
    26  {
    27  public :
    28      // -----------------------------------------------------------
------------
    29      //  Constructors and Destructor
    30      // -----------------------------------------------------------
------------
    31      XMLHolder();
    32
    33      ~XMLHolder();
    34
    35      Type    fInstance;

XMLHolder.c

    27  // ---------------------------------------------------------------
--------
    28  // XMLHolder:  Constructors and Destructor
    29  // ---------------------------------------------------------------
--------
    30
    31  template<class Type>
    32  XMLHolder<Type>::XMLHolder() :
    33      XMemory(),
    34      fInstance()
    35  {
    36  }


Regards
Manu


-------- Original-Nachricht --------
> Datum: Mon, 19 May 2008 12:25:19 +0200
> Von: "Manu Rapp" <[EMAIL PROTECTED]>
> An: [email protected]
> Betreff: problems compiling xerces on unixware

> Hello,
> 
> I'd like to ask for help compiling Xerces-c 2.7 on Unixware 7.1.3.
> 
> This is the error I get:
> 
> xerces-c-src_2_7_0/include/xercesc/util/XMLHolder.c:
> In method `xercesc_2_7::XMLHolder<volatile __pthread_mutex>::XMLHolder()':
> UnixWarePlatformUtils.cpp:409:
> instantiated from here
> xerces-c-src_2_7_0/include/xercesc/util/XMLHolder.c:32:
> conversion from `volatile pthread_mutex_t' to `const __pthread_mutex &'
> discards qualifiers
> /usr/gnu/lib/gcc-lib/i586-unknown-sysv5/2.95.3pl1/include/sys/types.h:671:
> in passing argument 1 of `__pthread_mutex::__pthread_mutex(const
> __pthread_mutex &)'
> 
> UnixwarePlatformUtils.cpp
> 
>    395  typedef XMLHolder<pthread_mutex_t>  MutexHolderType;
>    396
>    397  static MutexHolderType* gAtomicOpMutex = 0;
>    398
>    399  void XMLPlatformUtils::platformInit()
>    400  {
>    401      //
>    402      // The gAtomicOpMutex mutex needs to be created
>    403      // because compareAndSwap, atomicIncrement and atomicDecrement
>    404      // does not have the atomic system calls for usage
>    405      // Normally, mutexes are created on first use, but there is a
>    406      // circular dependency between compareAndExchange() and
>    407      // mutex creation that must be broken.
>    408
>    409      gAtomicOpMutex = new (fgMemoryManager) MutexHolderType;
> 
> types.h defines the following structure / type
> 
>    665  typedef volatile struct __pthread_mutex {
>    666          mutex_t                 __pt_mutex_mutex;
>    667          pid_t                   __pt_mutex_pid;
>    668          thread_t                __pt_mutex_owner;
>    669          int                     __pt_mutex_depth;
>    670          pthread_mutexattr_t     __pt_mutex_attr;
>    671  } pthread_mutex_t;
> 
> It seems Xerces expects __pthread_mutex to be const not volatile.
> But i couldn't find the according Xerces files to change this.
> 
> The error also showed up in version 2.8.
> 
> Please let me know which files i should change and how?
> 
> Regards
> Manu
> -- 
> Psssst! Schon vom neuen GMX MultiMessenger gehört?
> Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to