#1666 _GLIBCXX_DEBUG macro seems to break istringstream

component_package
closed
nobody
gcc-4.7.0 (11)
2012-10-19
2012-08-29
Rob Ross
No

After "g++ a.cpp", "a.exe" just prints "Done". After "g++ -D _GLIBCXX_DEBUG a.cpp", "a.exe" also surprisingly prints "Fail".

#include <iostream>
#include <sstream>
int main()
{
std::string s = "2";
std::istringstream in(s);
unsigned u = 0;
if ( !(in >> u) ) std::cerr << "Fail\n";
std::cout << "Done\n";
}

Host OS: 64-bit Windows 7 Pro

gcc -v:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=c:/a/language/mingw/bin/../libexec/gcc/mingw32/4.7.0/lto-wrapper.exe
Target: mingw32
Configured with: ../gcc-4.7.0/configure --enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry --enable-libstdcxx-debug --disable-build-poststage1-with-cxx --enable-version-specific-runtime-libs --build=mingw32 --prefix=/mingw
Thread model: win32
gcc version 4.7.0 (GCC)

ld -v:
GNU ld (GNU Binutils) 2.22

Build Environments: Same results in cmd.exe and Cygwin

Discussion

  • Rob Ross

    Rob Ross - 2012-08-29

    Test case a.cpp

     
  • Earnie Boyd

    Earnie Boyd - 2012-08-30

    You should take this to the GCC bugs list.

     
  • Earnie Boyd

    Earnie Boyd - 2012-08-30
    • milestone: --> component_package
    • status: open --> pending
     
  • Rob Ross

    Rob Ross - 2012-08-30
    • status: pending --> open
     
  • Rob Ross

    Rob Ross - 2012-08-30

    Note that this problem does not occur on x86_64 Linux with Debian g++ 4.7.1-2.

     
  • Earnie Boyd

    Earnie Boyd - 2012-08-31

    That just means the issue is target specific. You need to take the issue up with the GCC bugs list.

     
  • Earnie Boyd

    Earnie Boyd - 2012-08-31
    • status: open --> pending
     
  • Earnie Boyd

    Earnie Boyd - 2012-10-19

    The issue belongs in GCC bugs list.

     
  • Earnie Boyd

    Earnie Boyd - 2012-10-19
    • status: pending --> closed
     

Log in to post a comment.