This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Need assistance QNX libc/GNU libstdc++ header file conflicts


In the 6.1 release, QNX dumped their own C library and GNU libstdc++
in favor of the DinkumWare C and C++ libraries.  As this resulted in
significant compile time (2-4x) and runtime (I don't recall the exact
figures for our application, but some basic operations were up to 28x
slower) decreases in performance, my boss asked me to look into doing
our own C++ development environment.

I've created a QNX gcc 3.1 port, but there are conflicts between the
GNU libstdc++ and the QNX C library headers which prevent libstdc++
from building.  While I've recently purchased and browsed the C++
standard (although probably not enough to count), I'm not sure who's
at fault.

For example, in QNX's <string.h> contains the equivalent of:

    #ifdef __cplusplus
    namespace std {
    inline void *memchr (void *_S, int _C, std::size_t _N)
    {
        union { void *_Out; const void * _In) _Result; 
        return (_Result._In = std::memchr((const void *)_S,_C,_N),Result._Out);
    }

    ...

    }
    #endif /* __cplusplus */

Which conflicts with libstdc++'s <cstring>'s:

    inline void *
    memchr(void* __p, int __c, size_t __n)
    { return memchr(const_cast<const void *>(__p), __c, __n); }


The same problem occurs for strchr, strrchr, strpbrk, abs, acos, tanhl, 
etc.  I don't know whether the Dinkum/QNX or the stdc++ headers are wrong, 
or if it's simply a matter of the two being incompatible with each other.
For the time being, I'm wrapping such definitions with ifndef __QNX__,
but I know is clearly not the right way...

Thanks,


	--jtc

-- 
J.T. Conklin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]