Package: g++-mingw-w64-x86-64
Version: 4.6.3-14+8
Severity: normal

x86_64-w64-mingw32-g++ has differing behaviour for stringstream, depending upon 
if -D_GLIBCXX_DEBUG is given or not. 

builder@builder:~/mingw-debian-cross/code/tmp$ x86_64-w64-mingw32-g++ test.cpp 
-o test 
builder@builder:~/mingw-debian-cross/code/tmp$ wine64 ./test
attempting to cast :-123 to string
worked
builder@builder:~/mingw-debian-cross/code/tmp$ x86_64-w64-mingw32-g++ test.cpp 
-o test  -D_GLIBCXX_DEBUG
builder@builder:~/mingw-debian-cross/code/tmp$ wine64 ./test
attempting to cast :-123 to string
failed.
builder@builder:~/mingw-debian-cross/code/tmp$ cat test.cpp
#include <sstream>
#include <string>
#include <iostream>

using namespace std;

template<class T1, class T2> bool stream_cast(T1 &result, const T2 &obj)
{
    std::stringstream ss;
    ss << obj;
    ss >> result;
    return ss.fail();
}

int main()
{
    int i;
    std::string s;
    i=-123;
    std::cerr << "attempting to cast :" << i << " to string" << std::endl;

    bool didFail = stream_cast(s,i);

    if(didFail)
        cerr << "failed." << endl;
    else
        cerr << "worked" << endl;
}


-- System Information:
Debian Release: 6.0.6
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/3 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages g++-mingw-w64-x86-64 depends on:
ii  gcc-mingw-w64-base       4.6.3-14+8      GNU Compiler Collection for MinGW-
ii  gcc-mingw-w64-x86-64     4.6.3-14+8      GNU C compiler for MinGW-w64 targe
ii  libc6                    2.13-38         Embedded GNU C Library: Shared lib
ii  libgmp10                 2:5.0.5+dfsg-2  Multiprecision arithmetic library
ii  libmpc2                  0.9-4           multiple precision complex floatin
ii  libmpfr4                 3.1.0-5         multiple precision floating-point 
ii  libstdc++6-4.6-dev       4.6.3-14        GNU Standard C++ Library v3 (devel
ii  zlib1g                   1:1.2.7.dfsg-13 compression library - runtime

g++-mingw-w64-x86-64 recommends no packages.

Versions of packages g++-mingw-w64-x86-64 suggests:
pn  gcc-4.6-locales               <none>     (no description available)

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to