Skip to content

Commit bd9891f

Browse files
committed
Suppress msvc warnings
1 parent a1c4475 commit bd9891f

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

example/file.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,14 @@ class file
7272
boost::json::error_code& ec)
7373
{
7474
close();
75+
#if defined(_MSC_VER)
76+
# pragma warning( push )
77+
# pragma warning( disable : 4996 )
78+
#endif
7579
f_ = std::fopen( path, mode );
80+
#if defined(_MSC_VER)
81+
# pragma warning( pop )
82+
#endif
7683
if( ! f_ )
7784
return fail(ec);
7885
if( std::fseek( f_, 0, SEEK_END ) != 0)

include/boost/json/storage_ptr.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,13 @@ class storage_ptr
458458
make_shared_resource(Args&&... args);
459459
};
460460

461+
#if defined(_MSC_VER)
462+
# pragma warning( push )
463+
# if !defined(__clang__) && _MSC_VER <= 1900
464+
# pragma message( "MSVC " )
465+
# pragma warning( disable : 4702 )
466+
# endif
467+
#endif
461468
/** Return shared ownership of a new, dynamically allocated memory resource.
462469
463470
This function dynamically allocates a new memory resource
@@ -493,6 +500,9 @@ make_shared_resource(Args&&... args)
493500
detail::shared_resource_impl<T>(
494501
std::forward<Args>(args)...));
495502
}
503+
#if defined(_MSC_VER)
504+
# pragma warning( pop )
505+
#endif
496506

497507
/** Return true if two storage pointers point to the same memory resource.
498508

0 commit comments

Comments
 (0)