Fix: compiler warnings - #2688
Conversation
…or equal than zero
the friend declaration is not realy needed
|
hi @hasan-htp, thanks for opening the PR. I will check this and see what we can do! |
hi @KerstinKeller |
| template <typename T, typename Serializer> | ||
| class OMessageChannel | ||
| { | ||
| friend OMessageChannel CreateChannel(OMeasurement& meas_, const std::string& channel_name_); |
There was a problem hiding this comment.
Why does this issue a warning? I think we need this friend declaration.
There was a problem hiding this comment.
this function is declared in line 80 as a template function. but this friend declaration itself is not template, this is what giving the warning.
The reason of removing the friend declaration is that the function is only using the constractor of OMessageChannel, which is public.
or am I missing something?
| static bool Serialize(const T& msg_, void* buffer_, size_t size_) | ||
| { | ||
| if (msg_.size() <= size_) | ||
| if (msg_.size() <= size_ && msg_.size() > 0) |
There was a problem hiding this comment.
with the addtional check in omeasurement.h, this check should not be necessary, as this function will never be called with size_ == 0
There was a problem hiding this comment.
oh yes, thanks, I will remove it
7e26e60 to
48309b8
Compare
Description
I used eCAL in a project via CMake FetchContent. -Werror is enabled globally in my project, and I encountered several CMake warnings. This PR addresses those gcc warnings.
Related issues