Closed skliper closed 4 years ago
As of right now this is the final core code change for 6.8 - @jphickey
When I test this I get the same results on extended vs. non-extended headers.
I would not expect the setting of this config option to change the alignment requirements of packets as most packets do not contain a CFE_SB_MsgId_t directly.
The reason there are just a few warnings in this build is because most of the alignment warnings were resolved in issue #437 and these are simply all that are left.
When I test this I get the same results on extended vs. non-extended headers.
Yes, that's why it's an issue we need to address now. Extended headers only fixes the alignment warning for packets that contain CFE_SB_MsgId_t.
@jphickey could you clarify what's the hold-up on resolving this issue? Your comments above make it sound like we are not on the same page.
@jphickey could you clarify what's the hold-up on resolving this issue? Your comments above make it sound like we are not on the same page.
The challenge here was to come up with something that wouldn't just hide the fundamental flaw (i.e. address the actual alignment of the message structure at issue) but also wouldn't affect other messages. Hopefully the PR that I just submitted will be acceptable.
The fix I'm proposing is split into two commits, the first just makes the CFE_SB_CmdHdr_t
/CFE_SB_TlmHdr_t
types correctly aligned for how they are actually used. Note most message definitions do not use this type - they define the message header as a uint8
array based on the sizeof()
this type (i.e. not aligned).
The second commit changes the header definition only on these particular message types that were generating warnings. This makes them aligned and fixes the warning.
Note the same thing should be done for all messages, because using a uint8[]
array is inherently unsafe/incorrect as it is not aligned for anything. It is only because most payloads contain a uint32
somewhere that it isn't getting warned about elsewhere.
Also note this PR only fixes warnings within the FSW code. I'm still seeing several alignment cast warnings in the unit test code on my 32-bit test platform. Will submit a separate issue about that.
Concurrence received on applying this pattern on all the messages, we'll manage the impact of tlm changes as part of this cycle.
Is your feature request related to a problem? Please describe.
Describe the solution you'd like Force alignment where possible without changing bits on the wire
Describe alternatives you've considered Remove
-Wcast-align
for this buildAdditional context Note there are other alignment issues for other configuration options (#313, #314) but they don't show up for MCP750 with CCSDS Version 2 so aren't critical to 6.8.
Requester Info Jacob Hageman - NASA/GSFC