Suppress another GCC 16 warning - #60
Open
soerengrunewald wants to merge 1 commit into
Open
Conversation
[Why] The compiler complains about this: > In static member function ‘static std::enable_if_t<((bool)std::is_nothrow_move_constructible<T>::value)> gul17::SmallVector<ElementT, in_capacity>::uninitialized_move(T*, T*, T*) [with T = unsigned int; ElementT = unsigned int; long unsigned int in_capacity = 8]’, > inlined from ‘static std::enable_if_t<((bool)std::is_nothrow_move_constructible<T>::value)> gul17::SmallVector<ElementT, in_capacity>::uninitialized_move_or_copy(T*, T*, T*) [with T = unsigned int; ElementT = unsigned int; long unsigned int in_capacity = 8]’ at gul17/SmallVector.h:1676:27, > inlined from ‘void gul17::SmallVector<ElementT, in_capacity>::move_or_copy_all_elements_from(gul17::SmallVector<ElementT, in_capacity>&&) [with ElementT = unsigned int; long unsigned int in_capacity = 8]’ at gul17/SmallVector.h:1560:39, > inlined from ‘void gul17::SmallVector<ElementT, in_capacity>::move_or_copy_all_elements_from(gul17::SmallVector<ElementT, in_capacity>&&) [with ElementT = unsigned int; long unsigned int in_capacity = 8]’ at gul17/SmallVector.h:1546:10, > ---8<--- > inlined from ‘void CATCH2_INTERNAL_TEST_188()’ at clientlib/tests/test_serialization.cc:3305:1: > gul17/SmallVector.h:1664:13: warning: ‘void* __builtin_memcpy(void*, const void*, long unsigned int)’ forming offset [440, 751] is out of the bounds [0, 440] of object ‘<anonymous>’ with type ‘const doocs::Field [5]’ [-Warray-bounds=] > 1664 | ::new (static_cast<void*>(dest)) ValueType(std::move(*src)); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [How] Disable the warning for now. But if we do so, we trigger a second warning, which we need to disable as well. Signed-off-by: Soeren Grunewald <soeren.grunewald@desy.de>
Member
|
Maybe we could add a short comment on why this suppression is necessary and on what compiler? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The compiler complains about this:
How
Disable the warning for now. But if we do so, we trigger a second warning, which we need to disable as well.
This is a followup to #59