diff --git a/doc/interprocess.qbk b/doc/interprocess.qbk index d4b49136..2587d57b 100644 --- a/doc/interprocess.qbk +++ b/doc/interprocess.qbk @@ -6808,6 +6808,7 @@ thank them: [section:release_notes_boost_1_79_00 Boost 1.79 Release] * Fixed bugs: + * [@https://github.com/boostorg/interprocess/issues/160 GitHub #160 (['"More GCC suggest-override warnings"])]. * [@https://github.com/boostorg/interprocess/pull/162 GitHub #162 (['"Fix missing sys/stat.h include on musl-based systems"])]. [endsect] diff --git a/include/boost/interprocess/detail/in_place_interface.hpp b/include/boost/interprocess/detail/in_place_interface.hpp index 367f9dca..6ba6229b 100644 --- a/include/boost/interprocess/detail/in_place_interface.hpp +++ b/include/boost/interprocess/detail/in_place_interface.hpp @@ -54,14 +54,14 @@ struct placement_destroy : public in_place_interface : in_place_interface(::boost::container::dtl::alignment_of::value, sizeof(T), typeid(T).name()) {} - virtual void destroy_n(void *mem, std::size_t num, std::size_t &destroyed) + virtual void destroy_n(void *mem, std::size_t num, std::size_t &destroyed) BOOST_OVERRIDE { T* memory = static_cast(mem); for(destroyed = 0; destroyed < num; ++destroyed) (memory++)->~T(); } - virtual void construct_n(void *, std::size_t, std::size_t &) {} + virtual void construct_n(void *, std::size_t, std::size_t &) BOOST_OVERRIDE {} private: void destroy(void *mem) diff --git a/include/boost/interprocess/detail/managed_multi_shared_memory.hpp b/include/boost/interprocess/detail/managed_multi_shared_memory.hpp index 68799b02..4ce23408 100644 --- a/include/boost/interprocess/detail/managed_multi_shared_memory.hpp +++ b/include/boost/interprocess/detail/managed_multi_shared_memory.hpp @@ -126,7 +126,7 @@ class basic_managed_multi_shared_memory group_services(frontend_t *const frontend) : mp_frontend(frontend), m_group(0), m_min_segment_size(0){} - virtual std::pair create_new_segment(size_type alloc_size) + virtual std::pair create_new_segment(size_type alloc_size) BOOST_OVERRIDE { (void)alloc_size; /* //We should allocate an extra byte so that the @@ -144,10 +144,10 @@ class basic_managed_multi_shared_memory return result_type(static_cast(0), 0); } - virtual bool update_segments () + virtual bool update_segments BOOST_OVERRIDE () { return true; } - virtual ~group_services(){} + virtual ~group_services() BOOST_OVERRIDE{} void set_group(segment_group_id group) { m_group = group; } diff --git a/include/boost/interprocess/detail/named_proxy.hpp b/include/boost/interprocess/detail/named_proxy.hpp index f3eb61d3..57a908f2 100644 --- a/include/boost/interprocess/detail/named_proxy.hpp +++ b/include/boost/interprocess/detail/named_proxy.hpp @@ -66,7 +66,7 @@ struct CtorArgN : public placement_destroy virtual void construct_n(void *mem , std::size_t num - , std::size_t &constructed) + , std::size_t &constructed) BOOST_OVERRIDE { T* memory = static_cast(mem); for(constructed = 0; constructed < num; ++constructed){ @@ -200,7 +200,7 @@ struct CtorArg##N : placement_destroy\ CtorArg##N ( BOOST_MOVE_UREF##N )\ BOOST_MOVE_COLON##N BOOST_MOVE_FWD_INIT##N{}\ \ - virtual void construct_n(void *mem, std::size_t num, std::size_t &constructed)\ + virtual void construct_n(void *mem, std::size_t num, std::size_t &constructed) BOOST_OVERRIDE\ {\ T* memory = static_cast(mem);\ for(constructed = 0; constructed < num; ++constructed){\ @@ -230,7 +230,7 @@ struct CtorIt##N : public placement_destroy\ CtorIt##N ( BOOST_MOVE_VAL##N )\ BOOST_MOVE_COLON##N BOOST_MOVE_VAL_INIT##N{}\ \ - virtual void construct_n(void *mem, std::size_t num, std::size_t &constructed)\ + virtual void construct_n(void *mem, std::size_t num, std::size_t &constructed) BOOST_OVERRIDE\ {\ T* memory = static_cast(mem);\ for(constructed = 0; constructed < num; ++constructed){\ diff --git a/include/boost/interprocess/detail/os_thread_functions.hpp b/include/boost/interprocess/detail/os_thread_functions.hpp index 81ec62cf..624321fc 100644 --- a/include/boost/interprocess/detail/os_thread_functions.hpp +++ b/include/boost/interprocess/detail/os_thread_functions.hpp @@ -601,7 +601,7 @@ class launch_thread_impl : f_( f ) {} - void run() + virtual void run() BOOST_OVERRIDE { f_(); } private: diff --git a/include/boost/interprocess/smart_ptr/detail/bad_weak_ptr.hpp b/include/boost/interprocess/smart_ptr/detail/bad_weak_ptr.hpp index 3e2b4df3..e2ce9a78 100644 --- a/include/boost/interprocess/smart_ptr/detail/bad_weak_ptr.hpp +++ b/include/boost/interprocess/smart_ptr/detail/bad_weak_ptr.hpp @@ -36,7 +36,7 @@ class bad_weak_ptr { public: - virtual char const * what() const BOOST_NOEXCEPT_OR_NOTHROW + virtual char const * what() const BOOST_NOEXCEPT_OR_NOTHROW BOOST_OVERRIDE { return "boost::interprocess::bad_weak_ptr"; } }; diff --git a/include/boost/interprocess/streams/bufferstream.hpp b/include/boost/interprocess/streams/bufferstream.hpp index 46979d7b..51987233 100644 --- a/include/boost/interprocess/streams/bufferstream.hpp +++ b/include/boost/interprocess/streams/bufferstream.hpp @@ -88,7 +88,7 @@ class basic_bufferbuf : basic_streambuf_t(), m_mode(mode), m_buffer(buf), m_length(length) { this->set_pointers(); } - virtual ~basic_bufferbuf(){} + virtual ~basic_bufferbuf() BOOST_OVERRIDE {} public: //!Returns the pointer and size of the internal buffer. @@ -115,14 +115,14 @@ class basic_bufferbuf } protected: - virtual int_type underflow() + virtual int_type underflow() BOOST_OVERRIDE { // Precondition: gptr() >= egptr(). Returns a character, if available. return this->gptr() != this->egptr() ? CharTraits::to_int_type(*this->gptr()) : CharTraits::eof(); } - virtual int_type pbackfail(int_type c = CharTraits::eof()) + virtual int_type pbackfail(int_type c = CharTraits::eof()) BOOST_OVERRIDE { if(this->gptr() != this->eback()) { if(!CharTraits::eq_int_type(c, CharTraits::eof())) { @@ -147,7 +147,7 @@ class basic_bufferbuf return CharTraits::eof(); } - virtual int_type overflow(int_type c = CharTraits::eof()) + virtual int_type overflow(int_type c = CharTraits::eof()) BOOST_OVERRIDE { if(m_mode & std::ios_base::out) { if(!CharTraits::eq_int_type(c, CharTraits::eof())) { @@ -181,7 +181,7 @@ class basic_bufferbuf virtual pos_type seekoff(off_type off, std::ios_base::seekdir dir, std::ios_base::openmode mode - = std::ios_base::in | std::ios_base::out) + = std::ios_base::in | std::ios_base::out) BOOST_OVERRIDE { bool in = false; bool out = false; @@ -246,7 +246,7 @@ class basic_bufferbuf } virtual pos_type seekpos(pos_type pos, std::ios_base::openmode mode - = std::ios_base::in | std::ios_base::out) + = std::ios_base::in | std::ios_base::out) BOOST_OVERRIDE { return seekoff(pos - pos_type(off_type(0)), std::ios_base::beg, mode); } private: diff --git a/include/boost/interprocess/streams/vectorstream.hpp b/include/boost/interprocess/streams/vectorstream.hpp index d2cec0a2..36ed3915 100644 --- a/include/boost/interprocess/streams/vectorstream.hpp +++ b/include/boost/interprocess/streams/vectorstream.hpp @@ -214,7 +214,7 @@ class basic_vectorbuf } protected: - virtual int_type underflow() + virtual int_type underflow() BOOST_OVERRIDE { if (base_t::gptr() == 0) return CharTraits::eof(); @@ -229,7 +229,7 @@ class basic_vectorbuf return CharTraits::eof(); } - virtual int_type pbackfail(int_type c = CharTraits::eof()) + virtual int_type pbackfail(int_type c = CharTraits::eof()) BOOST_OVERRIDE { if(this->gptr() != this->eback()) { if(!CharTraits::eq_int_type(c, CharTraits::eof())) { @@ -254,7 +254,7 @@ class basic_vectorbuf return CharTraits::eof(); } - virtual int_type overflow(int_type c = CharTraits::eof()) + virtual int_type overflow(int_type c = CharTraits::eof()) BOOST_OVERRIDE { if(m_mode & std::ios_base::out) { if(!CharTraits::eq_int_type(c, CharTraits::eof())) { @@ -289,7 +289,7 @@ class basic_vectorbuf virtual pos_type seekoff(off_type off, std::ios_base::seekdir dir, std::ios_base::openmode mode - = std::ios_base::in | std::ios_base::out) + = std::ios_base::in | std::ios_base::out) BOOST_OVERRIDE { //Get seek mode bool in(0 != (mode & std::ios_base::in)), out(0 != (mode & std::ios_base::out)); @@ -357,7 +357,7 @@ class basic_vectorbuf } virtual pos_type seekpos(pos_type pos, std::ios_base::openmode mode - = std::ios_base::in | std::ios_base::out) + = std::ios_base::in | std::ios_base::out) BOOST_OVERRIDE { return seekoff(pos - pos_type(off_type(0)), std::ios_base::beg, mode); } private: diff --git a/include/boost/interprocess/sync/windows/named_condition_any.hpp b/include/boost/interprocess/sync/windows/named_condition_any.hpp index 04990058..c00601cd 100644 --- a/include/boost/interprocess/sync/windows/named_condition_any.hpp +++ b/include/boost/interprocess/sync/windows/named_condition_any.hpp @@ -231,33 +231,33 @@ class winapi_named_condition_any : m_condition_data(cond_data) {} - virtual std::size_t get_data_size() const + virtual std::size_t get_data_size() const BOOST_OVERRIDE { return sizeof(sem_counts); } - virtual const void *buffer_with_final_data_to_file() + virtual const void *buffer_with_final_data_to_file() BOOST_OVERRIDE { sem_counts[0] = m_condition_data.m_sem_block_queue.value(); sem_counts[1] = m_condition_data.m_sem_block_lock.value(); return &sem_counts; } - virtual const void *buffer_with_init_data_to_file() + virtual const void *buffer_with_init_data_to_file() BOOST_OVERRIDE { sem_counts[0] = 0; sem_counts[1] = 1; return &sem_counts; } - virtual void *buffer_to_store_init_data_from_file() + virtual void *buffer_to_store_init_data_from_file() BOOST_OVERRIDE { return &sem_counts; } - virtual bool open(create_enum_t op, const char *id_name) + virtual bool open(create_enum_t op, const char *id_name) BOOST_OVERRIDE { return this->open_impl(op, id_name); } - virtual bool open(create_enum_t op, const wchar_t *id_name) + virtual bool open(create_enum_t op, const wchar_t *id_name) BOOST_OVERRIDE { return this->open_impl(op, id_name); } - virtual void close() + virtual void close() BOOST_OVERRIDE { m_condition_data.m_sem_block_queue.close(); m_condition_data.m_sem_block_lock.close(); @@ -267,7 +267,7 @@ class winapi_named_condition_any m_condition_data.m_nwaiters_to_unblock = 0; } - virtual ~named_cond_callbacks() + virtual ~named_cond_callbacks() BOOST_OVERRIDE {} private: diff --git a/include/boost/interprocess/sync/windows/named_mutex.hpp b/include/boost/interprocess/sync/windows/named_mutex.hpp index 98f5b9cb..b3d3246e 100644 --- a/include/boost/interprocess/sync/windows/named_mutex.hpp +++ b/include/boost/interprocess/sync/windows/named_mutex.hpp @@ -90,19 +90,19 @@ class winapi_named_mutex : m_mtx_wrapper(mtx_wrapper) {} - virtual std::size_t get_data_size() const + virtual std::size_t get_data_size() const BOOST_OVERRIDE { return 0u; } - virtual const void *buffer_with_init_data_to_file() + virtual const void *buffer_with_init_data_to_file() BOOST_OVERRIDE { return 0; } - virtual const void *buffer_with_final_data_to_file() + virtual const void *buffer_with_final_data_to_file() BOOST_OVERRIDE { return 0; } - virtual void *buffer_to_store_init_data_from_file() + virtual void *buffer_to_store_init_data_from_file() BOOST_OVERRIDE { return 0; } - virtual bool open(create_enum_t, const char *id_name) + virtual bool open(create_enum_t, const char *id_name) BOOST_OVERRIDE { std::string aux_str = "Global\\bipc.mut."; aux_str += id_name; @@ -112,7 +112,7 @@ class winapi_named_mutex return m_mtx_wrapper.open_or_create(aux_str.c_str(), mut_perm); } - virtual bool open(create_enum_t, const wchar_t *id_name) + virtual bool open(create_enum_t, const wchar_t *id_name) BOOST_OVERRIDE { std::wstring aux_str = L"Global\\bipc.mut."; aux_str += id_name; @@ -122,12 +122,12 @@ class winapi_named_mutex return m_mtx_wrapper.open_or_create(aux_str.c_str(), mut_perm); } - virtual void close() + virtual void close() BOOST_OVERRIDE { m_mtx_wrapper.close(); } - virtual ~named_mut_callbacks() + virtual ~named_mut_callbacks() BOOST_OVERRIDE {} private: diff --git a/include/boost/interprocess/sync/windows/named_semaphore.hpp b/include/boost/interprocess/sync/windows/named_semaphore.hpp index da5b78f2..bd3cff37 100644 --- a/include/boost/interprocess/sync/windows/named_semaphore.hpp +++ b/include/boost/interprocess/sync/windows/named_semaphore.hpp @@ -81,19 +81,19 @@ class winapi_named_semaphore : m_sem_wrapper(sem_wrapper), m_sem_count(sem_cnt) {} - virtual std::size_t get_data_size() const + virtual std::size_t get_data_size() const BOOST_OVERRIDE { return sizeof(sem_count_t); } - virtual const void *buffer_with_final_data_to_file() + virtual const void *buffer_with_final_data_to_file() BOOST_OVERRIDE { return &m_sem_count; } - virtual const void *buffer_with_init_data_to_file() + virtual const void *buffer_with_init_data_to_file() BOOST_OVERRIDE { return &m_sem_count; } - virtual void *buffer_to_store_init_data_from_file() + virtual void *buffer_to_store_init_data_from_file() BOOST_OVERRIDE { return &m_sem_count; } - virtual bool open(create_enum_t, const char *id_name) + virtual bool open(create_enum_t, const char *id_name) BOOST_OVERRIDE { std::string aux_str = "Global\\bipc.sem."; aux_str += id_name; @@ -106,7 +106,7 @@ class winapi_named_semaphore , winapi_semaphore_wrapper::MaxCount, sem_perm, created); } - virtual bool open(create_enum_t, const wchar_t *id_name) + virtual bool open(create_enum_t, const wchar_t *id_name) BOOST_OVERRIDE { std::wstring aux_str = L"Global\\bipc.sem."; aux_str += id_name; @@ -119,12 +119,12 @@ class winapi_named_semaphore , winapi_semaphore_wrapper::MaxCount, sem_perm, created); } - virtual void close() + virtual void close() BOOST_OVERRIDE { m_sem_wrapper.close(); } - virtual ~named_sem_callbacks() + virtual ~named_sem_callbacks() BOOST_OVERRIDE {} private: diff --git a/test/shared_ptr_test.cpp b/test/shared_ptr_test.cpp index d2767312..9ffc7001 100644 --- a/test/shared_ptr_test.cpp +++ b/test/shared_ptr_test.cpp @@ -41,7 +41,7 @@ class derived_class : public base_class { public: - virtual ~derived_class() + virtual ~derived_class() BOOST_OVERRIDE {} }; @@ -286,9 +286,9 @@ struct X struct Y: public X { Y(){ ++cnt; } - virtual ~Y(){ --cnt; } + virtual ~Y() BOOST_OVERRIDE{ --cnt; } - virtual int id() const + virtual int id() const BOOST_OVERRIDE { return 2; } private: