[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: -fshort-wchar in g++ (wstring & wchar_t)
From: |
Paul Pluzhnikov |
Subject: |
Re: -fshort-wchar in g++ (wstring & wchar_t) |
Date: |
Thu, 04 Aug 2005 08:01:12 -0700 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux) |
"Vinu" <vinuwarrier@yahoo.com> writes:
> I compiled my program with -fshort-wchar option
Not a smart thing to do. 'info gcc' has this to say about it:
*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.
IOW, you have to make sure that *all* code that you link against is
compiled with the same -fshort-wchart setting.
> str.append(Node);
In the case above, you are using
std::basic_string<wchar_t, ... >::append(wchar_t const*)
from libstdc++.so which (I am guessing) you did not recompile with
-fshort-wchart, and which therefore uses different ABI.
In doing so, you create the bug you've observed (and possibly many
more bugs you didn't observe yet).
Don't use switches which change ABI, unless you understand what
you are doing.
Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.