diff --git a/src/cpp/rtps/builtin/discovery/endpoint/EDP.cpp b/src/cpp/rtps/builtin/discovery/endpoint/EDP.cpp index e20f5d74afe..c70932a95e2 100644 --- a/src/cpp/rtps/builtin/discovery/endpoint/EDP.cpp +++ b/src/cpp/rtps/builtin/discovery/endpoint/EDP.cpp @@ -487,8 +487,8 @@ bool EDP::unpairWriterProxy( { if (r.matched_writer_remove(writer_guid, removed_by_lease)) { - const GUID_t& reader_guid = r.getGuid(); #if HAVE_SECURITY + const GUID_t& reader_guid = r.getGuid(); mp_RTPSParticipant->security_manager().remove_writer(reader_guid, participant_guid, writer_guid); #endif // if HAVE_SECURITY @@ -854,6 +854,7 @@ bool EDP::pairingReader( #else if (R->matched_writer_add(*wdatait)) { + static_cast(reader_guid); // Void cast to force usage if we don't have LOG_INFOs EPROSIMA_LOG_INFO(RTPS_EDP_MATCH, "WP:" << wdatait->guid() << " match R:" << reader_guid << ". RLoc:" << wdatait->remote_locators());