Cast to void
Prevent warnings from popping up in GCC >= 8.1
In file included from utp_api.cpp:26:
utp_internal.h: In constructor ‘UTPSocketKey::UTPSocketKey(const PackedSockAddr&, uint32)’:
utp_internal.h:79:32: warning: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘struct UTPSocketKey’; use assignment instead [-Wclass-memaccess]
79 | memset(this, 0, sizeof(*this));
| ^
utp_internal.h:74:8: note: ‘struct UTPSocketKey’ declared here
74 | struct UTPSocketKey {
| ^~~~~~~~~~~~
Resolved like in this issue: https://github.com/intel/tbb/issues/54
Apologies for breaking the silence :speak_no_evil:. Is the PR good enough to be merged as it is without removing the line?
Hi again! I was going through the list of my PRs and I noticed this one hasn't been active for quite some time. Personally, I find warnings in my build logs not pretty, and this PR addresses that issue. Would it be able to get this merged, or should I close it and leave the warnings?
Hi, what is the status of this PR pls ? I'm using libutp in golang and that (a small okay but still one) problem, I'm making a lib with it and gcc warning are not a good figure to end user even if there is 5 lib layer between libutp and the end user.
I would approve a PR that removes the memset and adds the static_assert I suggested earlier. nut I don’t have privileges to merge
Any update on this? Would anyone be willing to merge this?
I do not think this proposed patch is a good solution to the GCC warning. The warning is right, this patch just silences it instead of fixing the code.