Skip to content

Commit 5d8bebb

Browse files
committed
Avoid GCC 4.x warning for calling memset with a constant size of zero
1 parent f431f5a commit 5d8bebb

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

include/boost/circular_buffer/debug.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ const int UNINITIALIZED = 0xcc;
3434

3535
template <class T>
3636
inline void do_fill_uninitialized_memory(T* data, std::size_t size_in_bytes) BOOST_NOEXCEPT {
37+
#if defined(__GNUC__) && __GNUC__ < 5
38+
// Avoid warning for calling memset with a constant size of zero
39+
if( size_in_bytes )
40+
#endif
3741
std::memset(static_cast<void*>(data), UNINITIALIZED, size_in_bytes);
3842
}
3943

0 commit comments

Comments
 (0)