Opened 8 years ago

Last modified 7 years ago

#10911 new Bugs

boost/iostreams/filter/zlib.hpp gives C4275 warning with visual studio

Reported by: Joseph Southwell <joseph@…> Owned by: Jonathan Turkanis
Milestone: To Be Determined Component: iostreams
Version: Boost 1.57.0 Severity: Cosmetic
Keywords: Cc:

Description

please change the line

# pragma warning(disable:4251 4231 4660)         // Dependencies not exported.

to

# pragma warning(disable:4251 4231 4660 4275)         // Dependencies not exported.

This will fix...

1>c:\development\boost_1_56_0\boost\iostreams\filter\zlib.hpp(138): warning C4275: non dll-interface class 'std::ios_base::failure' used as base for dll-interface class 'boost::iostreams::zlib_error'
1>          c:\program files (x86)\microsoft visual studio 12.0\vc\include\xiosbase(221) : see declaration of 'std::ios_base::failure'
1>          c:\development\boost_1_56_0\boost\iostreams\filter\zlib.hpp(138) : see declaration of 'boost::iostreams::zlib_error'

Attachments (1)

boost_1_58_0-IOStreamsWarnings.patch (1.6 KB ) - added by peter.klotz@… 7 years ago.
Patch to fix the warnings

Download all attachments as: .zip

Change History (2)

comment:1 by peter.klotz@…, 7 years ago

We see the same kind of compiler warnings (in Boost 1.58.0) but emitted from several locations:

I:\Boost\1.58.0\include\boost/iostreams/filter/bzip2.hpp(112) : warning C4275: non dll-interface class 
  'std::ios_base::failure' used as base for dll-interface class 'boost::iostreams::bzip2_error'
        xiosbase(221) : see declaration of 'std::ios_base::failure'
        I:\Boost\1.58.0\include\boost/iostreams/filter/bzip2.hpp(112) : see declaration of 'boost::iostreams::bzip2_error'
I:\Boost\1.58.0\include\boost/iostreams/filter/zlib.hpp(138) : warning C4275: non dll-interface class 
  'std::ios_base::failure' used as base for dll-interface class 'boost::iostreams::zlib_error'
        xiosbase(221) : see declaration of 'std::ios_base::failure'
        I:\Boost\1.58.0\include\boost/iostreams/filter/zlib.hpp(138) : see declaration of 'boost::iostreams::zlib_error'
I:\Boost\1.58.0\include\boost/iostreams/filter/gzip.hpp(356) : warning C4251:
'boost::iostreams::detail::gzip_header::file_name_' : class 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>' 
  needs to have dll-interface to be used by clients of class 'boost::iostreams::detail::gzip_header'
I:\Boost\1.58.0\include\boost/iostreams/filter/gzip.hpp(357) : warning C4251:
'boost::iostreams::detail::gzip_header::comment_' : class 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>' 
  needs to have dll-interface to be used by clients of class 'boost::iostreams::detail::gzip_header'

According to the MSDN C4275 and C4251 are non critical when deriving from or using STL types.

C4275: https://msdn.microsoft.com/en-us/library/3tdb471s.aspx
C4251: https://msdn.microsoft.com/en-us/library/esew7y1w.aspx

Since both std::ios_base::failure and std::string are STL types there should be no side effects from suppressing these warnings.

by peter.klotz@…, 7 years ago

Patch to fix the warnings

Note: See TracTickets for help on using tickets.