This is the mail archive of the libstdc++@sources.redhat.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

SEGV fault when using wchar_t streams


Using gcc 2.95.2 and libstdc++ snapshot 2.90.8
 
I compile the following program with ./g++ -fhonor-std
 
      1 #include <iostream>
      2 int main(int argc, char* argv[])
      3 {
      4     std::wcout << L"H";
      5     std::wcout << L'i' << std::ends << std::endl;    // This appears to be the problem line
      6     std::wcout << L"This is going to die - bye" << std::endl;
      7 }
 
If I run the resulting program I get the following output:-
 
Hi
This is going to die - bye
Segmentation fault (core dumped)
 
If I comment out line 5 the problem goes away.  It seems the problem is related to the outputting of a wchar_t to a wchar_t stream.  I get the same error if I create a wofstream. 
 
The problem does not occur until program termination.
Rob Lugt

 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]