* [Comm] g++ 3.2.1 É wstring
@ 2003-02-07 13:53 Dmitry Koudryavtsev
2003-02-07 14:19 ` [Comm] g++ 3.2.1 и wstring Sergey Vlasov
0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Koudryavtsev @ 2003-02-07 13:53 UTC (permalink / raw)
To: community
Здравствуйте!
Вот, нарвался непонятно на что... :(
-fshort-wchar - баг компилятора или мои глюки ?
$ cat wc_test.cc
#include <string>
#include <cwchar>
using namespace std;
int main()
{
wstring s;
s = L"Teest 1"; // 7 wide chars !
printf("s.length()=%d, s.size()=%d\n",s.length(), s.size());
return 0;
}
$ g++ wc_test.cc -o wc_test
$ ./wc_test
>s.length()=7, s.size()=7
$ g++ wc_test.cc -o wc_test -fshort-wchar
$ ./wc_test
>s.length()=16, s.size()=16
>А должно быть 7 (!)
$ rpm -q gcc3.2-c++
gcc3.2-c++-3.2.1-alt2
>В 2.96 все прокатывает ( кроме вызова s.c_str() :)
>#select-gcc 2.96
$ g++ wc_test.cc -o wc_test
$ ./wc_test
>s.length()=7, s.size()=7
$ g++ wc_test.cc -o wc_test -fshort-wchar
$ ./wc_test
>s.length()=7, s.size()=7
--
С уважением,
Dmitry Koudryavtsev
mailto:juliasoft@mail.ru
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Comm] g++ 3.2.1 и wstring
2003-02-07 13:53 [Comm] g++ 3.2.1 É wstring Dmitry Koudryavtsev
@ 2003-02-07 14:19 ` Sergey Vlasov
0 siblings, 0 replies; 2+ messages in thread
From: Sergey Vlasov @ 2003-02-07 14:19 UTC (permalink / raw)
To: community
On Fri, 7 Feb 2003 16:53:18 +0300
Dmitry Koudryavtsev <juliasoft@mail.ru> wrote:
> Вот, нарвался непонятно на что... :(
> -fshort-wchar - баг компилятора или мои глюки ?
Это не будет работать по причине
// Inhibit implicit instantiations for required instantiations,
// which are defined via explicit instantiations elsewhere.
// NB: This syntax is a GNU extension.
...
extern template class basic_string<wchar_t>;
Код для wstring уже сгенерирован и находится в libstdc++, поэтому
просто сменить размер wchar_t не удастся - нужно всё пересобирать.
Либо использовать вместо wchar_t другой тип с определением для него
char_traits и т.п.
Ещё очень неприятно, что теперь нельзя определить __USE_MALLOC - по
тем же самым причинам.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-02-07 14:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-07 13:53 [Comm] g++ 3.2.1 É wstring Dmitry Koudryavtsev
2003-02-07 14:19 ` [Comm] g++ 3.2.1 и wstring Sergey Vlasov
ALT Linux Community general discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
public-inbox-index community
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.community
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git