[PATCH][Wave] Fix some wave/cpp.cpp compile problems

This is the set of fixes that have accumulated for CVS version of wave/cpp.cpp. It still fails to build for me with gcc 4.1.0 with gcc-C++-action ../../../bin/boost/tools/wave/build/wave/gcc/release/cpp.o ../cpp.cpp: In function 'void<unnamed>::save_state(const boost::program_options::variables_map&, const Context&) [with Context = context_type]': ../cpp.cpp:882: instantiated from here ../cpp.cpp:483: error: no match for 'operator<<' in 'oa << std::basic_string<char, std::char_traits<char>, std::allocator<char>
(((const char*)"0x010204"), ((const std::allocator<char>&)((const std::allocator<char>*)(& std::allocator<char>()))))' /abuild/rguenther/boost/boost/boost/archive/detail/interface_oarchive.hpp:78: note: candidates are: Archive& boost::archive::detail::interface_oarchive<Archive>::operator<<(T&) [with T = std::string, Archive = boost::archive::binary_oarchive]
Thanks, Richard. Index: tools/wave/cpp.cpp =================================================================== RCS file: /cvsroot/boost/boost/tools/wave/cpp.cpp,v retrieving revision 1.25 diff -u -r1.25 cpp.cpp --- tools/wave/cpp.cpp 21 Mar 2006 15:31:42 -0000 1.25 +++ tools/wave/cpp.cpp 11 May 2006 14:54:08 -0000 @@ -146,7 +146,7 @@ /////////////////////////////////////////////////////////////////////////////// // forward declarations only -namespace cmd_line_utils +namespace cmd_line_util { class include_paths; } @@ -154,7 +154,7 @@ namespace boost { namespace program_options { void validate(boost::any &v, std::vector<std::string> const &s, - cmd_line_utils::include_paths *, int); + cmd_line_util::include_paths *, long); }} // boost::program_options @@ -273,7 +273,7 @@ namespace boost { namespace program_options { void validate(boost::any &v, std::vector<std::string> const &s, - cmd_line_util::include_paths *, int) + cmd_line_util::include_paths *, long) { cmd_line_util::include_paths::validate(v, s); } @@ -422,11 +422,11 @@ if (state_file == "-") state_file = fs::path("wave.state", fs::native); - using std::ios_base::openmode; - openmode mode = ios_base::in; + typedef std::ios_base::openmode openmode; + openmode mode = std::ios_base::in; #if BOOST_WAVE_BINARY_SERIALIZATION != 0 - mode = (openmode)(mode | ios_base::binary); + mode = (openmode)(mode | std::ios_base::binary); #endif ifstream ifs (state_file.string().c_str(), mode); if (ifs.is_open()) { @@ -466,13 +466,13 @@ if (state_file == "-") state_file = fs::path("wave.state", fs::native); - using std::ios_base::openmode; - openmode mode = ios_base::out; + typedef std::ios_base::openmode openmode; + openmode mode = std::ios_base::out; #if BOOST_WAVE_BINARY_SERIALIZATION != 0 - mode = (openmode)(mode | ios_base::binary); + mode = (openmode)(mode | std::ios_base::binary); #endif - ofstream ofs(state_file.string().c_str(), mode); + std::ofstream ofs(state_file.string().c_str(), mode); if (!ofs.is_open()) { cerr << "wave: could not open state file for writing: " << state_file.string() << endl; @@ -848,7 +848,7 @@ // print out the current token value if (allow_output) { - if (output.rdstate() & (ios::badbit | ios::failbit | ios::eofbit)) + if (output.rdstate() & (std::ios::badbit | std::ios::failbit | std::ios::eofbit)) { cerr << "wave: problem writing to the current " << "output file" << endl;

Richard Guenther wrote:
This is the set of fixes that have accumulated for CVS version of wave/cpp.cpp. It still fails to build for me with gcc 4.1.0 with
Thanks for the patch. Most of the problems you're correcting are fixed in the CVS for a couple of weeks now already. Unfortunately the readonly sourceforge CVS seems to be out of sync with the developer CVS for roughly 2 month. I'll incorporate the remaining tweaks into the CVS as soon as possible.
gcc-C++-action ../../../bin/boost/tools/wave/build/wave/gcc/release/cpp.o ../cpp.cpp: In function 'void<unnamed>::save_state(const boost::program_options::variables_map&, const Context&) [with Context = context_type]': ../cpp.cpp:882: instantiated from here ../cpp.cpp:483: error: no match for 'operator<<' in 'oa << std::basic_string<char, std::char_traits<char>, std::allocator<char>
(((const char*)"0x010204"), ((const std::allocator<char>&)((const std::allocator<char>*)(& std::allocator<char>()))))' /abuild/rguenther/boost/boost/boost/archive/detail/interface_o archive.hpp:78: note: candidates are: Archive& boost::archive::detail::interface_oarchive<Archive>::operator< <(T&) [with T = std::string, Archive = boost::archive::binary_oarchive]
This one is fixed in the (developer) CVS already. Regards Hartmut PS: If you're interested in getting an upto date version of Wave please drop me a note. I'll send you the current snapshot privately then.

On Thu, 11 May 2006, Hartmut Kaiser wrote:
Richard Guenther wrote:
This is the set of fixes that have accumulated for CVS version of wave/cpp.cpp. It still fails to build for me with gcc 4.1.0 with
Thanks for the patch. Most of the problems you're correcting are fixed in the CVS for a couple of weeks now already. Unfortunately the readonly sourceforge CVS seems to be out of sync with the developer CVS for roughly 2 month. I'll incorporate the remaining tweaks into the CVS as soon as possible.
Doh! Now, I happen to have a sourceforge account, but I guess it can't be used on the boost repository. But the fix you mention in the other mail will get me going again! Thanks! Richard. -- Richard Guenther <rguenther@suse.de> Novell / SUSE Labs
participants (2)
-
Hartmut Kaiser
-
Richard Guenther