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 Abhi <at...@Adobe.COM> on 2000/12/05 03:40:53 UTC

changing typedefs of XMLCh gives errors.

Hi all,

I am having some problems with the wchar_t typedef for XMLCh on Solaris 2.6 
using gcc 2.95 compiler. When I try to assert the XMLCh size (which is 
typedef wchar_t ) with another typedef which is *unsigned short*, I get 
assertion failure. So, when I change the typedef of XMLCh from wchar_t to 
unsigned short (which should be equivalent) in the file GCCDefs.hpp, I run 
into a problem while compiling. I get an *out of virtual memory* error. And 
this error is coming from the equal() function in HashBase.cpp.

Obviously, it seems, unsigned short and wchar_t do not have the same size 
on Solaris. But, I can't figure out the reason behind *out of virtual 
memory* error.

Thanks,
Abhi.


Re: changing typedefs of XMLCh gives errors.

Posted by Dean Roddey <dr...@charmedquark.com>.
If the compiler is compliant, wchar_t and unsigned short are not equivalent,
though they might happen to be the same size. wchar_t is supposed to be a
unique type of its own, and can be whatever size the implementation chooses,
though it would be kind of silly for it to be less than 2 bytes in sizes,
since it wouldn't be very wide or very useful otherwise. On compilers that
aren't compliant, they will use a typedef, usually to unsigned short. But it
could be a 32 bit value as well.

--------------------------
Dean Roddey
The CIDLib C++ Frameworks
Charmed Quark Software
droddey@charmedquark.com
http://www.charmedquark.com

"It takes two buttocks to make friction"
    - African Proverb


----- Original Message -----
From: "Abhi" <at...@Adobe.COM>
To: <xe...@xml.apache.org>
Sent: Monday, December 04, 2000 6:40 PM
Subject: changing typedefs of XMLCh gives errors.


> Hi all,
>
> I am having some problems with the wchar_t typedef for XMLCh on Solaris
2.6
> using gcc 2.95 compiler. When I try to assert the XMLCh size (which is
> typedef wchar_t ) with another typedef which is *unsigned short*, I get
> assertion failure. So, when I change the typedef of XMLCh from wchar_t to
> unsigned short (which should be equivalent) in the file GCCDefs.hpp, I run
> into a problem while compiling. I get an *out of virtual memory* error.
And
> this error is coming from the equal() function in HashBase.cpp.
>
> Obviously, it seems, unsigned short and wchar_t do not have the same size
> on Solaris. But, I can't figure out the reason behind *out of virtual
> memory* error.
>
> Thanks,
> Abhi.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
>