From ae50b4bc6afa62663317e630aef509a29c4f9021 Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Thu, 29 Apr 2004 14:51:08 -0400 Subject: [PATCH] BUG: Add a safety check so that you cannot send cmOStringStream.str() to other stream and produce the funky hex number. This makes it impossible to compile such a code. Adding that exposed a whole bunch of places in CMake where streams were used wrongly --- Source/cmCTest.cxx | 10 +++++----- Source/cmStandardIncludes.h | 3 +++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index e7a03e45d..68322042e 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -4508,7 +4508,7 @@ int cmCTest::RunCMakeAndTest(std::string* outstring) } else { - std::cerr << out << "\n"; + std::cerr << out.str() << "\n"; } return 1; } @@ -4527,7 +4527,7 @@ int cmCTest::RunCMakeAndTest(std::string* outstring) } else { - std::cerr << out << "\n"; + std::cerr << out.str() << "\n"; } return 1; } @@ -4607,7 +4607,7 @@ int cmCTest::RunCMakeAndTest(std::string* outstring) } else { - std::cerr << out << "\n"; + std::cerr << out.str() << "\n"; } return 1; } @@ -4639,7 +4639,7 @@ int cmCTest::RunCMakeAndTest(std::string* outstring) } else { - std::cerr << out << "\n"; + std::cerr << out.str() << "\n"; } return 1; } @@ -4671,7 +4671,7 @@ int cmCTest::RunCMakeAndTest(std::string* outstring) } else { - std::cout << out << "\n"; + std::cout << out.str() << "\n"; } return retVal; } diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index 572bcac5f..662a83119 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -252,6 +252,9 @@ private: }; #endif +/* Poison this operator to avoid common mistakes. */ +extern void operator << (std::ostream&, const cmOStringStream&); + /** Standard documentation entry for cmDocumentation's formatting. */ struct cmDocumentationEntry {