Skip to content

Commit 10f1e87

Browse files
Merge pull request eclipse-iceoryx#1887 from ithier/iox-1394-fix-axivion-warnings-in-buffer-and-container-modules-3
Fix more warnings in vector.hpp & uninitialized_array.hpp
2 parents 18e7b34 + 5badc6f commit 10f1e87

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

iceoryx_hoofs/container/include/iox/uninitialized_array.hpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ struct ZeroedBuffer
3333
{
3434
struct alignas(ElementType) element_t
3535
{
36-
// AXIVION Next Construct AutosarC++19_03-A18.1.1 : required by low level UninitializedArray building block and encapsulated in abstraction
36+
// AXIVION Next Construct AutosarC++19_03-A18.1.1, AutosarC++19_03-M0.1.3 : required by low level UninitializedArray building block and encapsulated in abstraction, declaration of field in struct for usage elsewhere
3737
// NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays, hicpp-avoid-c-arrays)
3838
cxx::byte_t data[sizeof(ElementType)];
3939
};
40-
// AXIVION Next Construct AutosarC++19_03-A18.1.1 : required by low level UninitializedArray building block and encapsulated in abstraction
40+
// AXIVION Next Construct AutosarC++19_03-A18.1.1, AutosarC++19_03-A1.1.1 : required by low level UninitializedArray building block and encapsulated in abstraction, object size limit is not relevant for containers stored in shared memory.
4141
// NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays, hicpp-avoid-c-arrays)
4242
element_t value[Capacity]{};
4343
};
@@ -50,11 +50,11 @@ struct NonZeroedBuffer
5050
{
5151
struct alignas(ElementType) element_t
5252
{
53-
// AXIVION Next Construct AutosarC++19_03-A18.1.1 : required by low level UninitializedArray building block and encapsulated in abstraction
53+
// AXIVION Next Construct AutosarC++19_03-A18.1.1, AutosarC++19_03-M0.1.3 : required by low level UninitializedArray building block and encapsulated in abstraction, declaration of field in struct for usage elsewhere
5454
// NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays, hicpp-avoid-c-arrays)
5555
cxx::byte_t data[sizeof(ElementType)];
5656
};
57-
// AXIVION Next Construct AutosarC++19_03-A18.1.1 : required by low level UninitializedArray building block and encapsulated in abstraction
57+
// AXIVION Next Construct AutosarC++19_03-A18.1.1, AutosarC++19_03-A1.1.1 : required by low level UninitializedArray building block and encapsulated in abstraction, object size limit is not relevant for containers stored in shared memory
5858
// NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays, hicpp-avoid-c-arrays)
5959
element_t value[Capacity];
6060
};
@@ -66,6 +66,7 @@ struct NonZeroedBuffer
6666
/// @tparam Buffer is the policy parameter to choose between an uninitialized, not zeroed array (=NonZeroedBuffer,
6767
/// default) and an uninitialized array with all elements zeroed (=ZeroedBuffer)
6868
/// @note Out of bounds access leads to undefined behavior
69+
// AXIVION Next Construct AutosarC++19_03-A9.6.1 : type contains a single member that is a byte array whos size is defined by ElementType and Capacity
6970
template <typename ElementType, uint64_t Capacity, template <typename, uint64_t> class Buffer = NonZeroedBuffer>
7071
class UninitializedArray final
7172
{
@@ -111,6 +112,7 @@ class UninitializedArray final
111112
static constexpr uint64_t capacity() noexcept;
112113

113114
private:
115+
// AXIVION Next Construct AutosarC++19_03-A1.1.1 : object size limit is not relevant for containers stored in shared memory
114116
Buffer<ElementType, Capacity> m_buffer;
115117
};
116118

iceoryx_hoofs/container/include/iox/vector.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,7 @@ class vector final
218218

219219
void clearFrom(const uint64_t startPosition) noexcept;
220220

221-
// AXIVION Next Construct AutosarC++19_03-A1.1.1 : Object size limit is not relevant for
222-
// containers stored in shared memory.
221+
// AXIVION Next Construct AutosarC++19_03-A1.1.1 : Object size limit is not relevant for containers stored in shared memory.
223222
UninitializedArray<T, Capacity> m_data{};
224223
uint64_t m_size{0U};
225224
};

0 commit comments

Comments
 (0)