From a6dc6b3896a331abf972005cae350283491e9482 Mon Sep 17 00:00:00 2001 From: hasan-htp Date: Thu, 23 Jul 2026 23:25:28 +0200 Subject: [PATCH 1/4] [ecalhd5] fix Werror type-limits warning, unsigned is always greater or equal than zero --- contrib/ecalhdf5/src/eh5_meas_file_v2.cpp | 8 ++------ contrib/ecalhdf5/src/hdf5_helper.cpp | 19 ++++++++----------- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/contrib/ecalhdf5/src/eh5_meas_file_v2.cpp b/contrib/ecalhdf5/src/eh5_meas_file_v2.cpp index eedd93691b..a2dba3719b 100644 --- a/contrib/ecalhdf5/src/eh5_meas_file_v2.cpp +++ b/contrib/ecalhdf5/src/eh5_meas_file_v2.cpp @@ -275,14 +275,10 @@ bool eCAL::eh5::HDF5MeasFileV2::GetEntryData(long long entry_id, void* data) con if (dataset_id < 0) return false; - auto size = H5Dget_storage_size(dataset_id); - herr_t read_status = -1; - if (size >= 0) - { - read_status = H5Dread(dataset_id, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, data); - } + read_status = H5Dread(dataset_id, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, data); + H5Dclose(dataset_id); return (read_status >= 0); diff --git a/contrib/ecalhdf5/src/hdf5_helper.cpp b/contrib/ecalhdf5/src/hdf5_helper.cpp index 9817b0456c..e3c6ce91c7 100644 --- a/contrib/ecalhdf5/src/hdf5_helper.cpp +++ b/contrib/ecalhdf5/src/hdf5_helper.cpp @@ -72,13 +72,12 @@ bool ReadStringEntryAsString(hid_t root, const std::string& url, std::string& da const auto size = H5Dget_storage_size(dataset_id); herr_t read_status = -1; - if (size >= 0) - { - data.resize(size); - const auto string_data_type = H5Tcopy(H5T_C_S1); - H5Tset_size(string_data_type, size); - read_status = H5Dread(dataset_id, string_data_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, static_cast(const_cast(data.data()))); - } + + data.resize(size); + const auto string_data_type = H5Tcopy(H5T_C_S1); + H5Tset_size(string_data_type, size); + read_status = H5Dread(dataset_id, string_data_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, static_cast(const_cast(data.data()))); + H5Dclose(dataset_id); return (read_status >= 0); @@ -129,11 +128,9 @@ bool ReadBinaryEntryAsString(hid_t root, const std::string& url, std::string& da data.resize(size); herr_t read_status = -1; - if (size >= 0) - { - read_status = H5Dread(dataset_id, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, static_cast(const_cast(data.data()))); - } + read_status = H5Dread(dataset_id, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, static_cast(const_cast(data.data()))); + H5Dclose(dataset_id); return (read_status >= 0); } From 869fa9e6e8a52eaafe7926cd72f3ff2258261bda Mon Sep 17 00:00:00 2001 From: hasan-htp Date: Thu, 23 Jul 2026 23:26:40 +0200 Subject: [PATCH 2/4] [serialization] fix a Werror reorder warning --- serialization/common/common/include/ecal/msg/imeasurement.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/serialization/common/common/include/ecal/msg/imeasurement.h b/serialization/common/common/include/ecal/msg/imeasurement.h index 91d4acfb9c..8c59986c6c 100644 --- a/serialization/common/common/include/ecal/msg/imeasurement.h +++ b/serialization/common/common/include/ecal/msg/imeasurement.h @@ -44,8 +44,8 @@ namespace eCAL using MessageT = T; IMessageChannel(IChannel&& binary_channel_) - : m_serializer{std::make_shared()} - , binary_channel(std::move(binary_channel_)) + : binary_channel(std::move(binary_channel_)) + , m_serializer{std::make_shared()} { // We are trying to create a "strong" type, based on only a channel name // There is a good chance, that the created channel does not match the data From fbf66c18e5c8efee16e46ed771ef9fa918af75ef Mon Sep 17 00:00:00 2001 From: hasan-htp Date: Thu, 23 Jul 2026 23:27:06 +0200 Subject: [PATCH 3/4] [serialization] fix a Werror non-template-friend the friend declaration is not realy needed --- serialization/common/common/include/ecal/msg/omeasurement.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/serialization/common/common/include/ecal/msg/omeasurement.h b/serialization/common/common/include/ecal/msg/omeasurement.h index 269aae0772..10f3fca724 100644 --- a/serialization/common/common/include/ecal/msg/omeasurement.h +++ b/serialization/common/common/include/ecal/msg/omeasurement.h @@ -28,8 +28,6 @@ namespace eCAL template class OMessageChannel { - friend OMessageChannel CreateChannel(OMeasurement& meas_, const std::string& channel_name_); - public: // Should those be private? using SerializerT = Serializer; From 48309b8d68f8f9cb0477d0729271a33dc90b64c4 Mon Sep 17 00:00:00 2001 From: hasan-htp Date: Tue, 4 Aug 2026 00:01:40 +0200 Subject: [PATCH 4/4] [serialization] fix Werror nonnull --- serialization/common/common/include/ecal/msg/omeasurement.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/serialization/common/common/include/ecal/msg/omeasurement.h b/serialization/common/common/include/ecal/msg/omeasurement.h index 10f3fca724..f7dbe29b39 100644 --- a/serialization/common/common/include/ecal/msg/omeasurement.h +++ b/serialization/common/common/include/ecal/msg/omeasurement.h @@ -55,11 +55,7 @@ namespace eCAL // The way we handle Publishers requires us to do a two pass serialization; size_t message_size = m_serializer->MessageSize(entry_.message); buffer.resize(message_size); - if (message_size == 0) - { - m_serializer->Serialize(entry_.message, nullptr, 0); - } - else + if (message_size > 0) { m_serializer->Serialize(entry_.message, static_cast(&buffer[0]), buffer.size()); }