> and produces the wrong output: Thanks for your bug report. This is not a bug in gcc, but in your code. The data() function does not return a zero-terminated string; you need to use the c_str() function for that. If you replace all data() calls with c_str() your code works fine. Please read a C++ book for details. Regards, Martin