[Expat-bugs] [ expat-Bugs-1255896 ] Expat 1.95.8 ReadMe

SourceForge.net noreply at sourceforge.net
Wed Aug 10 17:43:13 CEST 2005


Bugs item #1255896, was opened at 2005-08-10 10:43
Message generated for change (Comment added) made by abhijitkankaria
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1255896&group_id=10127

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Documentation
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: abhijitk (abhijitkankaria)
Assigned to: Fred L. Drake, Jr. (fdrake)
Summary: Expat 1.95.8 ReadMe

Initial Comment:
>From Expat ReadMe:
--------------------------------------------------------------------------------------
If you are interested in building Expat to provide document
information in UTF-16 rather than the default UTF-8,
following these instructions:
  1. For UTF-16 output as unsigned short (and
version/error           strings as char), run:
               ./configure CPPFLAGS=-DXML_UNICODE

     For UTF-16 output as wchar_t (incl. version/error
strings),           run:
               ./configure CFLAGS="-g -O2 -fshort-wchar"                           CPPFLAGS=-DXML_UNICODE_WCHAR_T

  2. Edit the MakeFile, changing:
               LIBRARY = libexpat.la
           to:
               LIBRARY = libexpatw.la
           (Note the additional "w" in the library name.)

  3. Run "make buildlib" (which builds the library only).
  4. Run "make installlib" (which installs the library
only).
--------------------------------------------------------------------------------------
As per the defination of -fshort-wchar:

-fshort-wchar
         Override the underlying type for wchar_t to be
short
         unsigned int instead of the default for the
target.
         This option is useful for building programs to
run under
         WINE.
 
         Warning: the -fshort-wchar switch causes GCC
to     generate code that is not binary compatible with
code generated without that switch.  Use it to conform
to a non-default application binary interface.
--------------------------------------------------------------------------------------

So this indicates that the option -fshort-wchar is to
be used in case I need UTF-16 output as unsigned short.
But as the ReadMe suggests should I use the option
-fshort-wchar for UTF-16 output as wchar_t?

Please correct me if my understanding is incorrect.

----------------------------------------------------------------------

>Comment By: abhijitk (abhijitkankaria)
Date: 2005-08-10 11:43

Message:
Logged In: YES 
user_id=1312629

So wchar_t has to be two byte for expat to work correctly?

I am compiling a 32 bit applicaiton on Solaris, so if i dont
use the -fshort-wchar, wchar_t will be defined as long. My
code does not depend on the size of wchar_t, will expat give
the desired result in this scenario?

Basically I am getting senmentation fault in my application
and so I am looking if the -fshort-wchar switch which causes
GCC to  generate code that is not binary compatible with
code generated without that switchoption is the reason.
My own libraries are build with this option but other system
libraries (from /usr/lib) are not compiled with this option.

----------------------------------------------------------------------

Comment By: Karl Waclawek (kwaclaw)
Date: 2005-08-10 11:02

Message:
Logged In: YES 
user_id=290026

No, use -fshort-wchar only if you want UTF-16 output
to be deliveerd as a *two-byte* wchar_t type (necessary 
because on Unix wchar_t is typically four bytes).

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1255896&group_id=10127


More information about the Expat-bugs mailing list