From 5d8bebb7614157768d49372618ebbe3049375820 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 3 Feb 2026 14:37:20 +0200 Subject: [PATCH] Avoid GCC 4.x warning for calling memset with a constant size of zero --- include/boost/circular_buffer/debug.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/boost/circular_buffer/debug.hpp b/include/boost/circular_buffer/debug.hpp index b6ab0fe..6559a67 100644 --- a/include/boost/circular_buffer/debug.hpp +++ b/include/boost/circular_buffer/debug.hpp @@ -34,6 +34,10 @@ const int UNINITIALIZED = 0xcc; template inline void do_fill_uninitialized_memory(T* data, std::size_t size_in_bytes) BOOST_NOEXCEPT { +#if defined(__GNUC__) && __GNUC__ < 5 + // Avoid warning for calling memset with a constant size of zero + if( size_in_bytes ) +#endif std::memset(static_cast(data), UNINITIALIZED, size_in_bytes); }