From 53571e58bf80190c6f02971b813475848f9fbd6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Skrzy=C5=84ski?= Date: Thu, 16 May 2024 17:04:13 +0200 Subject: [PATCH] #2264: work around gcc-8 limitations --- src/vt/context/runnable_context/trace.h | 2 +- src/vt/runnable/runnable.h | 7 ++- src/vt/vrt/context/context_vrt.cc | 49 ------------------- src/vt/vrt/context/context_vrt.h | 3 +- tests/unit/memory/test_memory_lifetime.cc | 4 +- .../termination/test_term_dep_send_chain.cc | 2 +- 6 files changed, 10 insertions(+), 57 deletions(-) delete mode 100644 src/vt/vrt/context/context_vrt.cc diff --git a/src/vt/context/runnable_context/trace.h b/src/vt/context/runnable_context/trace.h index e60800cfe2..becb7855a3 100644 --- a/src/vt/context/runnable_context/trace.h +++ b/src/vt/context/runnable_context/trace.h @@ -130,7 +130,7 @@ struct Trace { struct Trace { template - Trace([[maybe_unused]] Args&&... args) {} + Trace(Args&&...) {} }; diff --git a/src/vt/runnable/runnable.h b/src/vt/runnable/runnable.h index 50c929511c..62556472ca 100644 --- a/src/vt/runnable/runnable.h +++ b/src/vt/runnable/runnable.h @@ -45,6 +45,7 @@ #define INCLUDED_VT_RUNNABLE_RUNNABLE_H #include "vt/messaging/message/smart_ptr.h" +#include "vt/configs/debug/debug_var_unused.h" #include "vt/context/runnable_context/td.h" #include "vt/context/runnable_context/trace.h" #include "vt/context/runnable_context/set_context.h" @@ -120,11 +121,13 @@ struct RunnableNew { * * \param[in] in_is_threaded whether the handler can be run with a thread */ - explicit RunnableNew([[maybe_unused]] bool in_is_threaded) + explicit RunnableNew(bool in_is_threaded) #if vt_check_enabled(fcontext) : is_threaded_(in_is_threaded) #endif - { } + { + vt_force_use(in_is_threaded); // FIXME gcc-8 errors out on [[maybe_unused]] + } RunnableNew(RunnableNew&&) = default; RunnableNew(RunnableNew const&) = delete; diff --git a/src/vt/vrt/context/context_vrt.cc b/src/vt/vrt/context/context_vrt.cc deleted file mode 100644 index 7dd2c571d7..0000000000 --- a/src/vt/vrt/context/context_vrt.cc +++ /dev/null @@ -1,49 +0,0 @@ -/* -//@HEADER -// ***************************************************************************** -// -// context_vrt.cc -// DARMA/vt => Virtual Transport -// -// Copyright 2019-2021 National Technology & Engineering Solutions of Sandia, LLC -// (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. -// Government retains certain rights in this software. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact darma@sandia.gov -// -// ***************************************************************************** -//@HEADER -*/ - -#include "vt/config.h" -#include "vt/vrt/context/context_vrt.h" - -namespace vt { namespace vrt { - -}} // end namespace vt::vrt diff --git a/src/vt/vrt/context/context_vrt.h b/src/vt/vrt/context/context_vrt.h index 1fe80eb2fa..c45e492228 100644 --- a/src/vt/vrt/context/context_vrt.h +++ b/src/vt/vrt/context/context_vrt.h @@ -54,7 +54,6 @@ namespace vt { namespace vrt { struct VirtualContext : VrtBase { VirtualContext() = default; - VirtualContext([[maybe_unused]] bool const in_is_main) { } friend struct VirtualContextAttorney; @@ -64,7 +63,7 @@ struct VirtualContext : VrtBase { }; struct MainVirtualContext : VirtualContext { - MainVirtualContext() : VirtualContext(true) { } + MainVirtualContext() : VirtualContext() { } }; }} // end namespace vt::vrt diff --git a/tests/unit/memory/test_memory_lifetime.cc b/tests/unit/memory/test_memory_lifetime.cc index 31a8db3642..612500ac47 100644 --- a/tests/unit/memory/test_memory_lifetime.cc +++ b/tests/unit/memory/test_memory_lifetime.cc @@ -64,10 +64,10 @@ struct SerialTrackMsg : ::vt::Message { vt_msg_serialize_required(); SerialTrackMsg() { ++alloc_count; } - SerialTrackMsg([[maybe_unused]] SerialTrackMsg const& other) { + SerialTrackMsg(SerialTrackMsg const&) { ++alloc_count; } - SerialTrackMsg([[maybe_unused]] SerialTrackMsg&& other) { ++alloc_count; } + SerialTrackMsg(SerialTrackMsg&&) { ++alloc_count; } template void serialize(Serializer& s) { diff --git a/tests/unit/termination/test_term_dep_send_chain.cc b/tests/unit/termination/test_term_dep_send_chain.cc index bcf2268ee0..3a56a6a312 100644 --- a/tests/unit/termination/test_term_dep_send_chain.cc +++ b/tests/unit/termination/test_term_dep_send_chain.cc @@ -519,7 +519,7 @@ struct PrintParam { struct MergeCol : vt::Collection { MergeCol() = default; - MergeCol([[maybe_unused]] NodeType num, double off) : offset_( off ) { + MergeCol(NodeType, double off) : offset_( off ) { idx_ = getIndex(); }