eclipse-iceoryx / eclipse-iceoryx/iceoryx

Fix warnings with `-Wcast-align=strict`

Open
#1,778 1 comment 0 reactions 0 assignees View on GitHub
refactoring
Dominant language
C++
Stars
2.2k
Forks
492
Avg merge
18h 57m
Merged PRs (30d)
1

Description

## Brief feature description

When compiling with gcc and `-Wcast-align=strict` there are some warnings in the C binding and in the iceperf example. These should be fixed.

## Detailed information

For the warnings in the C binding @elBoberido proposes to replace
```
/// @brief handle of the chunk header
typedef struct
{
// could be empty but then we get `struct has no members` warning
uint8_t do_not_touch_me[1];
} iox_chunk_header_t;
```
with
```
/// @brief handle of the chunk header
typedef struct iox_chunk_header_opaque_t iox_chunk_header_t;
```

Additionally, see the following comments:
https://github.com/eclipse-iceoryx/iceoryx/pull/1774#discussion_r1015440294
https://github.com/eclipse-iceoryx/iceoryx/pull/1774#discussion_r1015530501

Contributor guide

Open the contributing guide

Research direction

Start by compiling the C binding and the iceperf example with GCC's -Wcast-align=strict, then inspect the warning locations and the two linked discussion comments. Apply the proposed opaque chunk-header approach where appropriate and address the remaining alignment warnings; done means both targets compile without these warnings.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, cpp
Domain
build-system, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.