Wesley Ranger
Wesley Ranger

Reputation: 780

A bunch of warning was given to this simple official boost::iostream code?

I am tring to write text file using boost, an real short and simple example from official document is:

#include <boost/iostreams/device/file.hpp>
#include <boost/iostreams/stream.hpp>

typedef stream<file_sink> ofstream;

ofstream out("HeavyArtillery.txt"); // Wilfred Owen
out << "Reach at that Arrogance which needs thy harm,\n"
       "And beat it down before its sins grow worse.\n";
out.close();

I did almost the same like this:

#include <boost/filesystem/path.hpp>
#include <boost/iostreams/device/file.hpp>
#include <boost/iostreams/stream.hpp>
typedef boost::iostreams::stream <boost::iostreams::file_sink> BoostIOStream;

BoostIOStream DebugFileOutputStream("IntermediaArrays.txt");

But the above code was give so many warnings like below. I am using cuda so the source file is named main.cu, but the compiler is nmake. Anybody please tell me what was wrong?

1>  Building NVCC (Device) object CMakeFiles/SrmLevelSet.dir/src/Debug/SrmLevelSet_generated_main.cu.obj
1>  main.cu
1>  
1>D:\dev\lib\boost_1_58_0\boost/iostreams/detail/streambuf/indirect_streambuf.hpp(50): warning : exception specification for implicitly declared virtual function "boost::iostreams::detail::indirect_streambuf<T, Tr, Alloc, Mode>::~indirect_streambuf [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]" is incompatible with that of overridden function "std::basic_streambuf<_Elem, _Traits>::~basic_streambuf [with _Elem=char, _Traits=std::char_traits<char>]"
1>  
1>            detected during:
1>  
1>              instantiation of class "boost::iostreams::detail::indirect_streambuf<T, Tr, Alloc, Mode> [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]" 
1>  
1>  D:\dev\lib\boost_1_58_0\boost/iostreams/stream_buffer.hpp(65): here
1>  
1>              instantiation of class "boost::iostreams::stream_buffer<T, Tr, Alloc, Mode> [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]" 
1>  
1>  D:\dev\lib\boost_1_58_0\boost/utility/base_from_member.hpp(127): here
1>  
1>              instantiation of class "boost::base_from_member<MemberType, UniqueID> [with MemberType=boost::iostreams::stream_buffer<boost::iostreams::file_sink, std::char_traits<char>, std::allocator<char>, boost::iostreams::output_seekable>, UniqueID=0]" 
1>  
1>  D:\dev\lib\boost_1_58_0\boost/iostreams/stream.hpp(75): here
1>  
1>              instantiation of class "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]" 
1>  
1>  D:\dev\lib\boost_1_58_0\boost/iostreams/stream.hpp(112): here
1>  
1>              instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]" 
1>  
1>  D:/SrmLevelSet/src/main.cu(46): here
1>  
1>  
1>  
1>D:\dev\lib\boost_1_58_0\boost/iostreams/detail/streambuf/indirect_streambuf.hpp(50): warning : exception specification for implicitly declared virtual function "boost::iostreams::detail::indirect_streambuf<T, Tr, Alloc, Mode>::~indirect_streambuf [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]" is incompatible with that of overridden function "boost::iostreams::detail::linked_streambuf<Ch, Tr>::~linked_streambuf [with Ch=char, Tr=std::char_traits<char>]"
1>  
1>            detected during:
1>  
1>              instantiation of class "boost::iostreams::detail::indirect_streambuf<T, Tr, Alloc, Mode> [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]" 
1>  
1>  D:\dev\lib\boost_1_58_0\boost/iostreams/stream_buffer.hpp(65): here
1>  
1>              instantiation of class "boost::iostreams::stream_buffer<T, Tr, Alloc, Mode> [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]" 
1>  
1>  D:\dev\lib\boost_1_58_0\boost/utility/base_from_member.hpp(127): here
1>  
1>              instantiation of class "boost::base_from_member<MemberType, UniqueID> [with MemberType=boost::iostreams::stream_buffer<boost::iostreams::file_sink, std::char_traits<char>, std::allocator<char>, boost::iostreams::output_seekable>, UniqueID=0]" 
1>  
1>  D:\dev\lib\boost_1_58_0\boost/iostreams/stream.hpp(75): here
1>  
1>              instantiation of class "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]" 
1>  
1>  D:\dev\lib\boost_1_58_0\boost/iostreams/stream.hpp(112): here
1>  
1>              instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]" 
1>  
1>  D:/SrmLevelSet/src/main.cu(46): here
1>  
1>  
1>  
1>D:\dev\lib\boost_1_58_0\boost/iostreams/stream_buffer.hpp(87): warning : exception specification for virtual function "boost::iostreams::stream_buffer<T, Tr, Alloc, Mode>::~stream_buffer [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]" is incompatible with that of overridden function "std::basic_streambuf<_Elem, _Traits>::~basic_streambuf [with _Elem=char, _Traits=std::char_traits<char>]"
1>  
1>            detected during:
1>  
1>              instantiation of class "boost::iostreams::stream_buffer<T, Tr, Alloc, Mode> [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]" 
1>  
1>  D:\dev\lib\boost_1_58_0\boost/utility/base_from_member.hpp(127): here
1>  
1>              instantiation of class "boost::base_from_member<MemberType, UniqueID> [with MemberType=boost::iostreams::stream_buffer<boost::iostreams::file_sink, std::char_traits<char>, std::allocator<char>, boost::iostreams::output_seekable>, UniqueID=0]" 
1>  
1>  D:\dev\lib\boost_1_58_0\boost/iostreams/stream.hpp(75): here
1>  
1>              instantiation of class "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]" 
1>  
1>  D:\dev\lib\boost_1_58_0\boost/iostreams/stream.hpp(112): here
1>  
1>              instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]" 
1>  
1>  D:/SrmLevelSet/src/main.cu(46): here
1>  
1>  
1>  
1>D:\dev\lib\boost_1_58_0\boost/iostreams/stream_buffer.hpp(87): warning : exception specification for virtual function "boost::iostreams::stream_buffer<T, Tr, Alloc, Mode>::~stream_buffer [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]" is incompatible with that of overridden function "boost::iostreams::detail::linked_streambuf<Ch, Tr>::~linked_streambuf [with Ch=char, Tr=std::char_traits<char>]"
1>  
1>            detected during:
1>  
1>              instantiation of class "boost::iostreams::stream_buffer<T, Tr, Alloc, Mode> [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]" 
1>  
1>  D:\dev\lib\boost_1_58_0\boost/utility/base_from_member.hpp(127): here
1>  
1>              instantiation of class "boost::base_from_member<MemberType, UniqueID> [with MemberType=boost::iostreams::stream_buffer<boost::iostreams::file_sink, std::char_traits<char>, std::allocator<char>, boost::iostreams::output_seekable>, UniqueID=0]" 
1>  
1>  D:\dev\lib\boost_1_58_0\boost/iostreams/stream.hpp(75): here
1>  
1>              instantiation of class "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]" 
1>  
1>  D:\dev\lib\boost_1_58_0\boost/iostreams/stream.hpp(112): here
1>  
1>              instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]" 
1>  
1>  D:/SrmLevelSet/src/main.cu(46): here
1>  
1>  
1>  
1>D:\dev\lib\boost_1_58_0\boost/iostreams/stream.hpp(74): warning : exception specification for implicitly declared virtual function "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base>::~stream_base [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]" is incompatible with that of overridden function "std::ios_base::~ios_base"
1>  
1>            detected during:
1>  
1>              instantiation of class "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]" 
1>  
1>  (112): here
1>  
1>              instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]" 
1>  
1>  D:/SrmLevelSet/src/main.cu(46): here
1>  
1>  
1>  
1>D:\dev\lib\boost_1_58_0\boost/iostreams/stream.hpp(74): warning : exception specification for implicitly declared virtual function "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base>::~stream_base [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]" is incompatible with that of overridden function "std::basic_ios<_Elem, _Traits>::~basic_ios [with _Elem=char, _Traits=std::char_traits<char>]"
1>  
1>            detected during:
1>  
1>              instantiation of class "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]" 
1>  
1>  (112): here
1>  
1>              instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]" 
1>  
1>  D:/SrmLevelSet/src/main.cu(46): here
1>  
1>  
1>  
1>D:\dev\lib\boost_1_58_0\boost/iostreams/stream.hpp(74): warning : exception specification for implicitly declared virtual function "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base>::~stream_base [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]" is incompatible with that of overridden function "std::basic_ostream<_Elem, _Traits>::~basic_ostream [with _Elem=char, _Traits=std::char_traits<char>]"
1>  
1>            detected during:
1>  
1>              instantiation of class "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]" 
1>  
1>  (112): here
1>  
1>              instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]" 
1>  
1>  D:/SrmLevelSet/src/main.cu(46): here
1>  
1>  
1>  
1>D:\dev\lib\boost_1_58_0\boost/iostreams/stream.hpp(112): warning : exception specification for implicitly declared virtual function "boost::iostreams::stream<Device, Tr, Alloc>::~stream [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]" is incompatible with that of overridden function "std::ios_base::~ios_base"
1>  
1>            detected during instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]" 
1>  
1>  D:/SrmLevelSet/src/main.cu(46): here
1>  
1>  
1>  
1>D:\dev\lib\boost_1_58_0\boost/iostreams/stream.hpp(112): warning : exception specification for implicitly declared virtual function "boost::iostreams::stream<Device, Tr, Alloc>::~stream [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]" is incompatible with that of overridden function "std::basic_ios<_Elem, _Traits>::~basic_ios [with _Elem=char, _Traits=std::char_traits<char>]"
1>  
1>            detected during instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]" 
1>  
1>  D:/SrmLevelSet/src/main.cu(46): here
1>  
1>  
1>  
1>D:\dev\lib\boost_1_58_0\boost/iostreams/stream.hpp(112): warning : exception specification for implicitly declared virtual function "boost::iostreams::stream<Device, Tr, Alloc>::~stream [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]" is incompatible with that of overridden function "std::basic_ostream<_Elem, _Traits>::~basic_ostream [with _Elem=char, _Traits=std::char_traits<char>]"
1>  
1>            detected during instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]" 
1>  
1>  D:/SrmLevelSet/src/main.cu(46): here
1>  
1>  
1>  
1>D:\dev\lib\boost_1_58_0\boost/array.hpp(123): warning : controlling expression is constant
1>  
1>  
1>  
1>D:\dev\lib\boost_1_58_0\boost/array.hpp(129): warning : controlling expression is constant
1>  
1>  
1>  
1>D:\dev\lib\boost_1_58_0\boost/iostreams/detail/streambuf/indirect_streambuf.hpp(50): warning : exception specification for implicitly declared virtual function "boost::iostreams::detail::indirect_streambuf<T, Tr, Alloc, Mode>::~indirect_streambuf [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]" is incompatible with that of overridden function "std::basic_streambuf<_Elem, _Traits>::~basic_streambuf [with _Elem=char, _Traits=std::char_traits<char>]"
1>  
1>            detected during:
1>  
1>              instantiation of class "boost::iostreams::detail::indirect_streambuf<T, Tr, Alloc, Mode> [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]" 
1>  
1>  D:\dev\lib\boost_1_58_0\boost/iostreams/stream_buffer.hpp(65): here
1>  
1>              instantiation of class "boost::iostreams::stream_buffer<T, Tr, Alloc, Mode> [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]" 
1>  
1>  D:\dev\lib\boost_1_58_0\boost/utility/base_from_member.hpp(127): here
1>  
1>              instantiation of class "boost::base_from_member<MemberType, UniqueID> [with MemberType=boost::iostreams::stream_buffer<boost::iostreams::file_sink, std::char_traits<char>, std::allocator<char>, boost::iostreams::output_seekable>, UniqueID=0]" 
1>  
1>  D:\dev\lib\boost_1_58_0\boost/iostreams/stream.hpp(75): here
1>  
1>              instantiation of class "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]" 
1>  
1>  D:\dev\lib\boost_1_58_0\boost/iostreams/stream.hpp(112): here
1>  
1>              instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]" 
1>  
1>  D:/SrmLevelSet/src/main.cu(46): here
1>  
1>  
1>  
1>D:\dev\lib\boost_1_58_0\boost/iostreams/detail/streambuf/indirect_streambuf.hpp(50): warning : exception specification for implicitly declared virtual function "boost::iostreams::detail::indirect_streambuf<T, Tr, Alloc, Mode>::~indirect_streambuf [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]" is incompatible with that of overridden function "boost::iostreams::detail::linked_streambuf<Ch, Tr>::~linked_streambuf [with Ch=char, Tr=std::char_traits<char>]"
1>  
1>            detected during:
1>  
1>              instantiation of class "boost::iostreams::detail::indirect_streambuf<T, Tr, Alloc, Mode> [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]" 
1>  
1>  D:\dev\lib\boost_1_58_0\boost/iostreams/stream_buffer.hpp(65): here
1>  
1>              instantiation of class "boost::iostreams::stream_buffer<T, Tr, Alloc, Mode> [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]" 
1>  
1>  D:\dev\lib\boost_1_58_0\boost/utility/base_from_member.hpp(127): here
1>  
1>              instantiation of class "boost::base_from_member<MemberType, UniqueID> [with MemberType=boost::iostreams::stream_buffer<boost::iostreams::file_sink, std::char_traits<char>, std::allocator<char>, boost::iostreams::output_seekable>, UniqueID=0]" 
1>  
1>  D:\dev\lib\boost_1_58_0\boost/iostreams/stream.hpp(75): here
1>  
1>              instantiation of class "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]" 
1>  
1>  D:\dev\lib\boost_1_58_0\boost/iostreams/stream.hpp(112): here
1>  
1>              instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]" 
1>  
1>  D:/SrmLevelSet/src/main.cu(46): here
1>  
1>  
1>  
1>D:\dev\lib\boost_1_58_0\boost/iostreams/stream_buffer.hpp(87): warning : exception specification for virtual function "boost::iostreams::stream_buffer<T, Tr, Alloc, Mode>::~stream_buffer [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]" is incompatible with that of overridden function "std::basic_streambuf<_Elem, _Traits>::~basic_streambuf [with _Elem=char, _Traits=std::char_traits<char>]"
1>  
1>            detected during:
1>  
1>              instantiation of class "boost::iostreams::stream_buffer<T, Tr, Alloc, Mode> [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]" 
1>  
1>  D:\dev\lib\boost_1_58_0\boost/utility/base_from_member.hpp(127): here
1>  
1>              instantiation of class "boost::base_from_member<MemberType, UniqueID> [with MemberType=boost::iostreams::stream_buffer<boost::iostreams::file_sink, std::char_traits<char>, std::allocator<char>, boost::iostreams::output_seekable>, UniqueID=0]" 
1>  
1>  D:\dev\lib\boost_1_58_0\boost/iostreams/stream.hpp(75): here
1>  
1>              instantiation of class "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]" 
1>  
1>  D:\dev\lib\boost_1_58_0\boost/iostreams/stream.hpp(112): here
1>  
1>              instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]" 
1>  
1>  D:/SrmLevelSet/src/main.cu(46): here
1>  
1>  
1>  
1>D:\dev\lib\boost_1_58_0\boost/iostreams/stream_buffer.hpp(87): warning : exception specification for virtual function "boost::iostreams::stream_buffer<T, Tr, Alloc, Mode>::~stream_buffer [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]" is incompatible with that of overridden function "boost::iostreams::detail::linked_streambuf<Ch, Tr>::~linked_streambuf [with Ch=char, Tr=std::char_traits<char>]"
1>  
1>            detected during:
1>  
1>              instantiation of class "boost::iostreams::stream_buffer<T, Tr, Alloc, Mode> [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]" 
1>  
1>  D:\dev\lib\boost_1_58_0\boost/utility/base_from_member.hpp(127): here
1>  
1>              instantiation of class "boost::base_from_member<MemberType, UniqueID> [with MemberType=boost::iostreams::stream_buffer<boost::iostreams::file_sink, std::char_traits<char>, std::allocator<char>, boost::iostreams::output_seekable>, UniqueID=0]" 
1>  
1>  D:\dev\lib\boost_1_58_0\boost/iostreams/stream.hpp(75): here
1>  
1>              instantiation of class "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]" 
1>  
1>  D:\dev\lib\boost_1_58_0\boost/iostreams/stream.hpp(112): here
1>  
1>              instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]" 
1>  
1>  D:/SrmLevelSet/src/main.cu(46): here
1>  
1>  
1>  
1>D:\dev\lib\boost_1_58_0\boost/iostreams/stream.hpp(74): warning : exception specification for implicitly declared virtual function "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base>::~stream_base [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]" is incompatible with that of overridden function "std::ios_base::~ios_base"
1>  
1>            detected during:
1>  
1>              instantiation of class "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]" 
1>  
1>  (112): here
1>  
1>              instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]" 
1>  
1>  D:/SrmLevelSet/src/main.cu(46): here
1>  
1>  
1>  
1>D:\dev\lib\boost_1_58_0\boost/iostreams/stream.hpp(74): warning : exception specification for implicitly declared virtual function "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base>::~stream_base [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]" is incompatible with that of overridden function "std::basic_ios<_Elem, _Traits>::~basic_ios [with _Elem=char, _Traits=std::char_traits<char>]"
1>  
1>            detected during:
1>  
1>              instantiation of class "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]" 
1>  
1>  (112): here
1>  
1>              instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]" 
1>  
1>  D:/SrmLevelSet/src/main.cu(46): here
1>  
1>  
1>  
1>D:\dev\lib\boost_1_58_0\boost/iostreams/stream.hpp(74): warning : exception specification for implicitly declared virtual function "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base>::~stream_base [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]" is incompatible with that of overridden function "std::basic_ostream<_Elem, _Traits>::~basic_ostream [with _Elem=char, _Traits=std::char_traits<char>]"
1>  
1>            detected during:
1>  
1>              instantiation of class "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]" 
1>  
1>  (112): here
1>  
1>              instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]" 
1>  
1>  D:/SrmLevelSet/src/main.cu(46): here
1>  
1>  
1>  
1>D:\dev\lib\boost_1_58_0\boost/iostreams/stream.hpp(112): warning : exception specification for implicitly declared virtual function "boost::iostreams::stream<Device, Tr, Alloc>::~stream [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]" is incompatible with that of overridden function "std::ios_base::~ios_base"
1>  
1>            detected during instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]" 
1>  
1>  D:/SrmLevelSet/src/main.cu(46): here
1>  
1>  
1>  
1>D:\dev\lib\boost_1_58_0\boost/iostreams/stream.hpp(112): warning : exception specification for implicitly declared virtual function "boost::iostreams::stream<Device, Tr, Alloc>::~stream [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]" is incompatible with that of overridden function "std::basic_ios<_Elem, _Traits>::~basic_ios [with _Elem=char, _Traits=std::char_traits<char>]"
1>  
1>            detected during instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]" 
1>  
1>  D:/SrmLevelSet/src/main.cu(46): here
1>  
1>  
1>  
1>D:\dev\lib\boost_1_58_0\boost/iostreams/stream.hpp(112): warning : exception specification for implicitly declared virtual function "boost::iostreams::stream<Device, Tr, Alloc>::~stream [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]" is incompatible with that of overridden function "std::basic_ostream<_Elem, _Traits>::~basic_ostream [with _Elem=char, _Traits=std::char_traits<char>]"
1>  
1>            detected during instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]" 
1>  
1>  D:/SrmLevelSet/src/main.cu(46): here
1>  
1>  
1>  
1>  main.cu
1>  

Upvotes: 1

Views: 208

Answers (1)

Daniel Trebbien
Daniel Trebbien

Reputation: 39208

Although Boost has basic support for NVCC (see ticket #3919), it is not one of the primary or additional test compilers used to test a release. For the lists of primary and additional test compilers, see the release notes for the version of Boost that you are using.

From the warnings that you have posted, it appears that NVCC is not correctly setting the exception specification for an implicitly-declared destructor. See the [except.spec] section of the C++ specification. In particular, the exception specification for an implicitly-declared destructor f should allow all exceptions if any function that it invokes allows all exceptions, and should allow no exceptions if all functions that it invokes allow no exceptions. For example, with respect to the first warning, the implicitly declared boost::iostreams::detail::indirect_streambuf destructor should allow all exceptions because the explicitly-declared virtual std::basic_streambuf destructor allows all exceptions (see section [lib.streambuf] of the C++ specification). If I had to guess, it looks like NVCC is defaulting the exception specification of an implicitly-declared destructor to throw() (noexcept in C++11).

There are two warnings not regarding incompatible exception specifications:

1>D:\dev\lib\boost_1_58_0\boost/array.hpp(123): warning : controlling expression is constant
1>  
1>  
1>  
1>D:\dev\lib\boost_1_58_0\boost/array.hpp(129): warning : controlling expression is constant

These are probably due to the BOOST_ASSERT_MSG fallback to using the standard C assert() macro:

# define BOOST_ASSERT_MSG(expr, msg) assert((expr)&&(msg))

The &&(msg) part is just a trick that allows the message to be included in the stringification of the expression being asserted. (msg) as a boolean expression will be true when msg is a string literal (a constant).

Upvotes: 3

Related Questions