Re: note on wchar_t portability

From: Mike Nordell (tamlin@algonet.se)
Date: Mon May 06 2002 - 19:59:12 EDT

  • Next message: Rui Miguel Silva Seabra: "About AbiWord vs OEONE"

    Tomas Frydrych wrote:
    > I have noticed code like this in the Wordperfect importer:
    >
    > afunction(UT_uint32 * pN);
    > ...
    > wchar_t c;
    > afunction(&c);
    >
    > This assumes sizeof(wchar_t) == sizeof(UT_uint32). However,
    > sizeof(wchar_t) varies on different systems, so this is not portable.

    I might put some (more "to the metal") info here.

    IAFAIK GCC C++ compiler treats them as 32-bit entities, and the Microsoft
    MSVC compiler(s) treat them as 16-bit entities, making them inherently
    uncompatible.

    So much for making a "standard"... :-/

    In reality, wchar_t is useless for cross platform work. If you remember that
    you'll have no problem with it (since you won't be using it).

    /Mike



    This archive was generated by hypermail 2.1.4 : Mon May 06 2002 - 20:03:24 EDT